Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: About mysql connection
PostPosted: Mon Jun 18, 2012 10:39 am 
Offline
Newbie

Joined: Mon Jun 18, 2012 10:32 am
Posts: 3
Hello Everyone,

I am getting the error as

"ERROR:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"

Can anyone help me if you have experienced the same issue ?
Thanks in advance.
Vijay


Top
   
PostPosted: Mon Jun 18, 2012 11:43 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Is mysql running?
Try
Code:
service mysql start

What's the output of
Code:
ps aux | grep mysql
say?
What distribution are you running?
What do the logs in /var/log/mysql say?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Tue Jun 19, 2012 1:33 am 
Offline
Newbie

Joined: Mon Jun 18, 2012 10:32 am
Posts: 3
First command gives

mysql: unrecognized service

second command gives

root 14781 0.0 0.1 61260 668 pts/0 D+ 01:25 0:00 grep mysql
You have new mail in /var/spool/mail/root

I am using centos 5.6.



And the log says after restarting mysqld



Number of processes running now: 0
120618 01:55:09 mysqld restarted
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
120618 1:55:10 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
120618 1:55:10 InnoDB: Started; log sequence number 0 381122399
120618 01:55:11 mysqld ended


InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
120618 1:52:16 InnoDB: Started; log sequence number 0 381122399
120618 1:52:16 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.95' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution



Thanks.
Vijay


Top
   
PostPosted: Tue Jun 19, 2012 5:35 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Looks like mysql crashed for some reason, the correct start command on centos is
Code:
service mysqld start
give that a go and check the mysql logs again.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Tue Jun 19, 2012 5:53 am 
Offline
Newbie

Joined: Mon Jun 18, 2012 10:32 am
Posts: 3
Hi ,

After running the commnad as you mentioned mysql started.
And the log is:

Number of processes running now: 0
120619 05:45:57 mysqld restarted
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
120619 5:45:58 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
120619 5:45:58 InnoDB: Started; log sequence number 0 381122399
120619 05:45:59 mysqld ended


But still in my connection files it gives
"ERROR:Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)".


Top
   
PostPosted: Tue Jun 19, 2012 11:48 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Looks like your innodb settings have got corrupted some how, you have to real options. 1 restore from the latest backup you have or 2 try and recover the innodb tables see here http://dev.mysql.com/doc/refman/5.0/en/ ... overy.html

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: mattltm and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group