MySQL will not connect.
#1

Hello,

I'm currently setting up a VPS for samp, with mysql and web hosting. However when I attempt to start SA:MP I get this:
Quote:

[18:45:45] >> mysql_ping( Connection handle: 1 )
[18:45:45] CMySQLHandler::Ping() - You cannot call this function now. (Reason: Dead Connection)
[18:45:45] >> mysql_connect(localhost, mike, Server, ******) on port 3306
[18:45:45] CMySQLHandler::Connect() - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Error ID: 2002)
[18:45:45]
[18:45:45] ** MySQL Debugging enabled (09/28/13)
[18:45:45]
[18:45:45] >> mysql_query_callback( Connection handle: 1 )
[18:45:45] >> mysql_query_callback( Connection handle: 1 )
[18:46:47] >> mysql_ping( Connection handle: 1 )
[18:46:47] CMySQLHandler::Ping() - You cannot call this function now. (Reason: Dead Connection)
[18:46:47] >> mysql_connect(localhost, mike, Server, ******) on port 3306
[18:46:47] CMySQLHandler::Connect() - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Error ID: 2002)
[18:46:47] >> mysql_close( Connection handle: 1 )
[18:46:47] CMySQLHandler::~CMySQLHandler() - deconstructor called.
[18:46:47] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead)
[18:46:47] CMySQLHandler:isconnect() - You cannot call this function now. (Reason: Connection is dead)
[18:46:47] Unloading Plugin
[18:46:52] >> mysql_connect(localhost, mike, Server, ******) on port 3306
[18:46:52] CMySQLHandler::CMySQLHandler() - constructor called.
[18:46:52] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "Server" | Username: "mike"
[18:46:52] CMySQLHandler::Connect() - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Error ID: 2002)
[18:46:52] >> mysql_ping( Connection handle: 1 )
[18:46:52] CMySQLHandler::Ping() - You cannot call this function now. (Reason: Dead Connection)
[18:46:52] >> mysql_connect(localhost, mike, Server, ******) on port 3306
[18:46:52] CMySQLHandler::Connect() - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Error ID: 2002)
[18:46:52]
[18:46:52] ** MySQL Debugging enabled (09/28/13)
[18:46:52]
[18:46:52] >> mysql_query_callback( Connection handle: 1 )
[18:46:52] >> mysql_query_callback( Connection handle: 1 )

From the MySQL log. I'm using BlueG mysql plugin R14 I think.
Reply
#2

Where are you hosting your MySQL database? In the VPS?
Reply
#3

The MySQL database is installed into the VPS.
Reply
#4

You're using Debian system on your VPS? Try removing MySQL completely, and then re-install it on your VPS. Make sure to also ask the plugin developer on which version of MySQL do I install on the VPS.
Reply
#5

I'm using CentOS 6, I've reinstalled MySQL a few times. Still not working, any other ideas?
Reply
#6

Try using the host name as localhost, and make sure you got the password right!
Reply
#7

It's weird, I updated my MySQL plugin, now I get libmysqlclient_r.so.16 isn't found, even though it's installed. Fixed the above problem but now I have:
Quote:

[21:38:44] [ERROR] CMySQLConnection::Connect - (error #2002) Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Reply
#8

CMySQLHandler::Connect() - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)|


I am also having this issue, I know WHY i'm having it I just don't know where in the config to change it to fix it.

/var/run/mysqld/mysqld.sock is the wrong directory I need to change it to access /var/lib/mysqld/mysqld.sock
Reply
#9

Try creating a symbolic link, it might help:
Код:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
Reply
#10

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
Try creating a symbolic link, it might help:
Код:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
Yeah I was trying that right before I read your post still giving me the same error...

[08:46:04] >> mysql_connect( )
[08:46:04] CMySQLHandler::CMySQLHandler() - constructor called.
[08:46:04] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "pxgg" | Username: "root" ...
[08:46:04] CMySQLHandler::Connect() - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Error ID: 2002)
[08:46:04] >> mysql_query( Connection handle: 1 )
[08:46:04] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
[08:46:04] >> mysql_store_result( Connection handle: 1 )

There has to be a config file that I can use to change the path it tries to connect through.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)