SA-MP Forums Archive
Script not connecting 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)
+--- Thread: Script not connecting to MySQL server (/showthread.php?tid=626398)



Script not connecting to MySQL server - Stones - 14.01.2017

So i've been testing my script on my localhost for about 4 or 5 days now, everything works fine, every thing says, SQL data loads from phpmyadmin and well, everything works the way it should, so, i finally uploaded the script to my windows VPS, installed XAMP and then started the server, i went in game and i noticed that nothing had really loaded.

Код:
if(DEVMODE == 0)mysql_connect("localhost","root","samp","");
So thats the connection information for the MySQL server i've tried changing to 127.0.0.1 i've tried changing to the actual IP of the VPS and it just won't connect.

And yes, i've checked if it has a password on, it doesn't.

Any help would be greatly appreciated!


Re: Script not connecting to MySQL server - Stones - 14.01.2017

It's actually rejecting the connection now
Код:
[19:03:55] >> mysql_connect( )

[19:03:55] CMySQLHandler::CMySQLHandler() - constructor called.

[19:03:55] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp" | Username: "root" ...

[19:03:55] CMySQLHandler::Connect() - Access denied for user 'root'@'localhost' (using password: NO) (Error ID: 1045)



Re: Script not connecting to MySQL server - jlalt - 14.01.2017

Quote:
Originally Posted by Stones
Посмотреть сообщение
It's actually rejecting the connection now
Код:
[19:03:55] >> mysql_connect( )

[19:03:55] CMySQLHandler::CMySQLHandler() - constructor called.

[19:03:55] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "samp" | Username: "root" ...

[19:03:55] CMySQLHandler::Connect() - Access denied for user 'root'@'localhost' (using password: NO) (Error ID: 1045)
are you sure that your vps phpmyadmin page doesn't require password? mind if you sure it with me on private message?

also you may go to http://ip/phpmyadmin to see what's up there. good luck.


Re: Script not connecting to MySQL server - Stones - 14.01.2017

I reinstalled XAMP on my VPS and left the connection details unchanged, works now, thanks for the help anyway!


Re: Script not connecting to MySQL server - Vince - 14.01.2017

Security issues are through the roof. Never run shit as root and always use a password. The password for your admin account is probably "admin" or "password" as well.