Current time: 12-23-2024, 12:40 PM Hello There, Guest! (LoginRegister)


Post Reply 
[resolved] Mysql : Connection failed: SQLSTATE[HY000]
Author Message
theprincy Offline
Member
***

Posts: 311
Joined: Nov 2008
Reputation: 2
Post: #1
[resolved] Mysql : Connection failed: SQLSTATE[HY000]
I have this error on a server
Code:
Connection failed: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
, I have looked everywhere and I found only one page but I do not understand how I should solve the problem, someone can help me?
(This post was last modified: 01-05-2010 07:44 PM by theprincy.)
01-05-2010 02:46 AM
Visit this user's website Find all posts by this user Quote this message in a reply
theprincy Offline
Member
***

Posts: 311
Joined: Nov 2008
Reputation: 2
Post: #2
RE: Mysql : Connection failed: SQLSTATE[HY000]
and now i have

Connection failed: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)

how can I solve?
01-05-2010 05:13 AM
Visit this user's website Find all posts by this user Quote this message in a reply
motokochan Offline
Member
***

Posts: 274
Joined: Jul 2008
Reputation: 1
Post: #3
RE: Mysql : Connection failed: SQLSTATE[HY000]
What are you trying to do when you get this message?
01-05-2010 05:37 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kurgans Offline
Moderator
*****
Moderators

Posts: 1,565
Joined: Feb 2008
Reputation: 23
Post: #4
RE: Mysql : Connection failed: SQLSTATE[HY000]
I feel my English, I speak only Spanish and is very difficult for my help.
Google translate does not translate and what may cause a more serious error in your system

I had that problem and same error message was caused by rupture of maia database.
If it can not be your problem like mine.

You can test if this is the error renaming /var/lib/mysql/maia to /var/lib/mysql/maia1

Restart mysql

If that's not the error try the rest of their databases

I hope to help you in your problem
(This post was last modified: 01-05-2010 06:05 AM by kurgans.)
01-05-2010 06:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
theprincy Offline
Member
***

Posts: 311
Joined: Nov 2008
Reputation: 2
Post: #5
RE: Mysql : Connection failed: SQLSTATE[HY000]
hate google translate :@

then the problems I had I got around them on that server,

now on another machine

Connection failed: SQLSTATE [HY000] [2002] Can not connect to local MySQL server through socket '/ var / run / mysqld / mysqld.sock' (2)

the solution seems easy enough to create the file myslqld.sock and start the MySQL daemon
unfortunately it is not so

root@torino:/var/run/mysqld# touch /var/run/mysqld/mysqld.sock
root@torino:/var/run/mysqld# chown mysql /var/run/mysqld/mysqld.sock
root@torino:/var/run/mysqld# !/etc
/etc/init.d/mysql start
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
root@torino:/var/run/mysqld# ls -sl
totale 0
root@torino:/var/run/mysqld# ls -asl
totale 8
4 drwxrwxrwx 2 mysql root 4096 5 gen 10:25 .
4 drwxr-xr-x 14 root root 4096 5 gen 10:18 ..


the file mysqld.sock erased ideas for the solution?


__________________________________________________________________

mistero del informatica :
ha ripreso a funzionare da solo
(01-05-2010 05:13 AM)theprincy Wrote:  and now i have

Connection failed: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)

how can I solve?

(01-05-2010 05:37 AM)motokochan Wrote:  What are you trying to do when you get this message?

message out when you sign on the panel that both sites
then mistakenly

Connection failed: SQLSTATE [HY000] [2002] Can not connect to local MySQL server through socket '/ var / run / mysqld / mysqld.sock' (111)

I solved this way, but I'm not sure that is the correct way or if there are other solutions easier.

Then I deleted apache2 php5-mysql mysql-server and then install it again


while error

Connection failed: SQLSTATE [HY000] [2002] Can not connect to local MySQL server through socket '/ var / run / mysqld / mysqld.sock' (13)

I completed these steps,

cd / var / run / mysqld /
rm-Rf mysqld.sock
touch / var / run / mysqld / mysqld.sock
chown mysql: mysql mysqld.sock
/ etc / init.d / mysql start
(This post was last modified: 01-05-2010 07:51 PM by theprincy.)
01-05-2010 07:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
motokochan Offline
Member
***

Posts: 274
Joined: Jul 2008
Reputation: 1
Post: #6
RE: [resolved] Mysql : Connection failed: SQLSTATE[HY000]
You don't want to create the socket manually. It will keep MySQL from working if it tries to make one there. Likely, your socket file is somewhere else. You should check the MySQL init script and /etc/my.cnf to see if it is pointed elsewhere.
01-06-2010 03:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
theprincy Offline
Member
***

Posts: 311
Joined: Nov 2008
Reputation: 2
Post: #7
RE: [resolved] Mysql : Connection failed: SQLSTATE[HY000]
(01-06-2010 03:08 AM)motokochan Wrote:  You don't want to create the socket manually. It will keep MySQL from working if it tries to make one there. Likely, your socket file is somewhere else. You should check the MySQL init script and /etc/my.cnf to see if it is pointed elsewhere.



Indeed it should create the file automatically when you start mysql, but if steps are not going to create it and start the daemon bed at mysql.com
01-06-2010 05:56 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)