SA-MP Forums Archive
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=319242)



Mysql error. - budelis - 18.02.2012

Hello. I have problem with mysql connect,when i start server mysql don't load here:

Код:
[17:05:27] >> mysql_connect( )

[17:05:27] CMySQLHandler::CMySQLHandler() - constructor called.

[17:05:27] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "database" | Username: "root" ...

[17:05:28] CMySQLHandler::Connect() - Can't connect to MySQL server on '127.0.0.1' (10061) (Error ID: 2003)
Here is my codes:

Код:
#define MySQL_HOST "127.0.0.1"
#define MySQL_USER "root"
#define MySQL_DATA "database"
#define MySQL_PASS ""
OnGameModeInit

Код:
mysql_debug( true );
mysql_connect( MySQL_HOST,MySQL_USER,MySQL_DATA,MySQL_PASS );
if( mysql_ping( ) >= 1 )
{
print( "Prisijungeme prie MySQL sekmingai!" );
}
else
{
SendRconCommand( "exit" );
}
Mysql is on,and i use XAMPP program for on. I try go to 127.0.0.1/phymyadmin and all works fine.

Then where is bad?


Re: Mysql error. - Vince - 18.02.2012

Quote:

The error (2003) Can't connect to MySQL server on 'server' (10061) indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server.

http://dev.mysql.com/doc/refman/5.1/...to-server.html


Re: Mysql error. - Nonameman - 18.02.2012

pawn Код:
mysql_connect(MySQL_HOST, MySQL_USER, MySQL_DATA, MySQL_PASS);
if(mysql_ping() == 1) {
    mysql_debug(1);
} else {
    SendRconCommand( "exit" );
}



Re: Mysql error. - budelis - 19.02.2012

don't work..


Re: Mysql error. - dice7 - 19.02.2012

Do you even have a database running on your computer?


Re: Mysql error. - fiki574 - 19.02.2012

Do this:

1. Download this -> CLICK ME!
2. Install WAMP.
3. Start WAMP.
4. In your FS change this:
pawn Код:
#define MySQL_HOST "localhost"
#define MySQL_USER "root"
#define MySQL_DATA "database"
#define MySQL_PASS ""
5. Create new database at "phpmyadmin"
6 And voila - you are done!