SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/07/2014, 09:47 PM   #1
Emre__
Big Clucker
 
Join Date: Jun 2011
Posts: 89
Reputation: 0
Default MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

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.
Emre__ is offline   Reply With Quote
Old 29/07/2014, 10:34 PM   #2
sammp
Gangsta
 
sammp's Avatar
 
Join Date: Jan 2014
Posts: 613
Reputation: 49
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

Code!
__________________
SA-MP must become open-source to maximise longetivity of the project.
sammp is offline   Reply With Quote
Old 29/07/2014, 10:36 PM   #3
Emre__
Big Clucker
 
Join Date: Jun 2011
Posts: 89
Reputation: 0
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

Which code do you want me to provide?
Emre__ is offline   Reply With Quote
Old 29/07/2014, 10:55 PM   #4
sammp
Gangsta
 
sammp's Avatar
 
Join Date: Jan 2014
Posts: 613
Reputation: 49
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

Connection code!
__________________
SA-MP must become open-source to maximise longetivity of the project.
sammp is offline   Reply With Quote
Old 29/07/2014, 11:18 PM   #5
Emre__
Big Clucker
 
Join Date: Jun 2011
Posts: 89
Reputation: 0
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

Quote:
Originally Posted by sammp View Post
Connection code!

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

Last edited by Emre__; 30/07/2014 at 10:03 AM.
Emre__ is offline   Reply With Quote
Old 29/07/2014, 11:32 PM   #6
OldReece
Little Clucker
 
Join Date: Jul 2014
Posts: 2
Reputation: 0
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

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.
OldReece is offline   Reply With Quote
Old 29/07/2014, 11:55 PM   #7
Emre__
Big Clucker
 
Join Date: Jun 2011
Posts: 89
Reputation: 0
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

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.
Emre__ is offline   Reply With Quote
Old 30/07/2014, 12:52 AM   #8
OldReece
Little Clucker
 
Join Date: Jul 2014
Posts: 2
Reputation: 0
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

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

That's why you defined them like that.
OldReece is offline   Reply With Quote
Old 30/07/2014, 07:08 AM   #9
Raefal
Big Clucker
 
Join Date: Feb 2014
Location: Indonesia
Posts: 124
Reputation: 2
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

use symlink
Raefal is offline   Reply With Quote
Old 30/07/2014, 07:10 AM   #10
Raefal
Big Clucker
 
Join Date: Feb 2014
Location: Indonesia
Posts: 124
Reputation: 2
Default Re: MySQL Plugin r39-2 Error: Can't connect to local MySQL server through socket

ln -s directorynow/mysql.sock /var/run/mysqld/mysqld.sock
Raefal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql cannot connect to mysql server gotwarzone Scripting Help 2 09/11/2013 12:55 PM
Mysql Error using the Mysql 2.1.1 Plugin yvoms Scripting Help 2 07/06/2013 10:48 PM
How to connect mysql server with custom port?(using BlueG's plugin R6_2) yxliang Scripting Help 2 26/01/2013 04:07 PM
MySQL Plugin Version: 2.1.1 won't connect CoaPsyFactor Scripting Help 0 30/06/2012 03:02 AM
Can't connect to local MySQL server through socket '/tmp/mysql.sock' Ivan_Pantovic Help Archive 4 03/08/2011 01:50 PM


All times are GMT. The time now is 08:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.