MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket
#1

Hi,

I'm using MySQL Plugin r39-2 by BlueG and whenever I start up the server I do come up with the error

Code:
[ERROR] CMySQLConnection::Connect - (error #2002) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
My MySQL Login Informations are correct. I'm using mysql_static.so because others wants libmysqlclient.so.18 and libmysqlclient.so.16 which I don't have so they gave me this advice to use mysql_static.so but this gives the error.

This socket file cannot be found. My server is not on personal machine. It is a gameserver from nitrado.net. So give me an advice to how to fix it.
Reply
#2

Code!
Reply
#3

Which code do you want me to provide?
Reply
#4

Connection code!
Reply
#5

Quote:
Originally Posted by sammp
View Post
Connection code!
pawn Code:
#define MYSQL_HOST      "localhost"
#define MYSQL_USER      "mysql_user_name"
#define MYSQL_PASS      "password"
#define MYSQL_DB        "db_name"

new dbHandle;

dbHandle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS);
It doesn't work either 127.0.0.1 or localhost
Reply
#6

Quote:

It doesn't work either 127.0.0.1 or localhost

Lol man you are establishing your username as "mysql_user_name" and its password as "password"

You should therefore connect by those values.
Reply
#7

Quote:
Originally Posted by OldReece
View Post
Lol man you are establishing your username as "mysql_user_name" and its password as "password"

You should therefore connect by those values.
No, these values are censored.
Reply
#8

You should be able to login using that username and password respectively.

That's why you defined them like that.
Reply
#9

use symlink
Reply
#10

ln -s directorynow/mysql.sock /var/run/mysqld/mysqld.sock
Reply
#11

Quote:
Originally Posted by Raefal
View Post
ln -s directorynow/mysql.sock /var/run/mysqld/mysqld.sock
It's a game host, I do NOT have the control over the machine so I can't create symlink.

edit: I used global ip (not localhost or 127.0.0.1) to connect the database and somehow it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)