SA-MP Forums Archive
Cannot connect to mysql server - 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: Cannot connect to mysql server (/showthread.php?tid=122455)



Cannot connect to mysql server - Blekk - 22.01.2010

Hi,

I'm trying to create my own login system using G-sTyLeZzZ's mysql plugin but am falling at the first hurdle; I can't connect to the database.

I have put the libmysql.dll file in my sampserver folder, I have put the a_mysql include in the pawn includes folder, I have put the mysql.dll file in the plugins folder and I have added the line: "plugins mysql" to the server.cfg.

Maybe I'm just doing it wrong but I can't even connect, I try and do:

Код:
mysql_connect("localhost", "root", "test","pass");
But if I enclose that in an if statement or put the mysql_ping == 1 in an if statement, they both say that it hasn't connected, any ideas why?

Do I have to create the database somewhere else before? Or does this first time running it create a database called test?

Thanks for your time,

Blekk



Re: Cannot connect to mysql server - Blekk - 22.01.2010

How do I know what the correct ip, account, db and password are?

Do I have to set up the database externally somewhere first?