About mysql connection
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
5 Replies
Try````
service mysql start
What's the output of````
ps aux | grep mysql
say?
What distribution are you running?
What do the logs in /var/log/mysql say?
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
service mysqld start
give that a go and check the mysql logs again.
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)".