SA-MP Forums Archive
MySQL Connect failure - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL Connect failure (/showthread.php?tid=196403)



MySQL Connect failure - hanzen - 05.12.2010

Hello.

For some reason my gamemode refuses to connect to MySQL. I have made sure that the server is up and running (ping'ed and tried to connect with php). The mysql is included in the pwn file. libmysql.dll and mysql.dll is placed in the right folders. The DB information match.
Код:
#define SQL_HOST "localhost"
#define SQL_USER "root"
#define SQL_PASS "hidden"
#define SQL_DB "samp"
OnGameModeInit()
Код:
mysql_connect(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB);
Edit:
Here's the error.
Код:
[16:16:46] [MySQL] Error (0): Function: mysql_connect failed, mysql was not initialized on this handle.
Sincerly hanzen


Re: MySQL Connect failure - Hornet600 - 05.12.2010

Are you sura that you have a password in your mysql

i dont have pass for home server


Re: MySQL Connect failure - hanzen - 05.12.2010

Yes I'm sure I have a password. I use the same details and connect without any problems using PHP. Also note that I'm using the MySQL Plugin by g-stylaz R5


Re: MySQL Connect failure - Cameltoe - 05.12.2010

mysql_init(); before the connect part.


Re: MySQL Connect failure - hanzen - 05.12.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
mysql_init(); before the connect part.
Yeah I just realized. Thanks, solved now!