mysql error. - 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)
+--- Thread: mysql error. (
/showthread.php?tid=324773)
mysql error. -
budelis - 10.03.2012
When i launch my server i get warning in mysql log:
Код:
Failed to connect. Can't connect to MySQL server on 'localhost' (10061)
I download new samp server. Then i download this mysql plugin:
Код:
libmysql.dll into my server directory
Код:
a_mysql.inc into my pawno/include
Код:
mysql.dll into my plugins folder
Then i open lvdm gm and:
Код:
#define MySQL_HOST "localhost"
#define MySQL_USER "root"
#define MySQL_DATA "database"
#define MySQL_PASS ""
I add this at the top of my gm.
Under OnGameModeInit
Код:
mysql_connect(MySQL_HOST,MySQL_USER,MySQL_DATA,MySQL_PASS);
I use Xampp control to run mysql,apache services. I run them,but still my server don't run every time... that stupid warning.
I think i bad run that services, then i go to localhost/phpmyadmin
but all works fine.
Re: mysql error. -
Shabi RoxX - 10.03.2012
Are u sure all services are running.
Try localhoSt or 127.0.0.1 on Web browser to check Localhost is working
Re: mysql error. -
budelis - 10.03.2012
localhost is work fine thats why i don't understand why i get this warning...
Re: mysql error. -
Shabi RoxX - 10.03.2012
Are u sure there is database with name database ?
Re: mysql error. -
budelis - 10.03.2012
yes.
Re: mysql error. -
eesh - 11.03.2012
Which version are you trying to use? if R7 you'll need to have a threaded script for that. So try R6 (Not sure if thats the problem anyway)
Next thing you need to check is if you have some program running at that port. Usually Mysql runs on port 80 and skype blocks it. (R7 uses port 3306)
EDIT: Also before changing to R6 try
pawn Код:
mysql_connect(MySQL_HOST,MySQL_USER,MySQL_DATA,MySQL_PASS,80);
But I still recommend you to change to R6
Re: mysql error. -
Tanush123 - 11.03.2012
well i get the error with R7, change it to R6 and try (the include).
Re: mysql error. -
budelis - 11.03.2012
i had r6 and all worked well. But after some time i try run server and here! that stupid error... I think need change version and i changed it to r7 but the same problem is.
Re: mysql error. -
budelis - 11.03.2012
Now i remember i work with web and i downloaded WampServer. Maybe here is problem?