I also receive an error when trying to access the database from the command line:
# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
In the logs I found:
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Error in opening ./ibdata1
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Error in opening ./ibdata1
I was able to fix the problem by restoring the permissions on several files (modified from this post):
# cd /var/lib/mysql
# mkdir bak
# mv ibdata1 bak/.
# mv ib_logfile* bak/.
# cp -a bak/ibdata1 ibdata1
# cp -a bak/ib_logfile* .
# service mysql restart
# mkdir bak
# mv ibdata1 bak/.
# mv ib_logfile* bak/.
# cp -a bak/ibdata1 ibdata1
# cp -a bak/ib_logfile* .
# service mysql restart
No comments:
Post a Comment