[ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
問題描述:啟動MySQL後,出現連接不上,報 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
[[email protected] ~]# service mysql start
Starting MySQL [ OK ]
[[email protected] ~]# mysql -uroot -poracle
Warning: Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)
[[email protected]
ls: cannot access /var/lib/mysql/mysql.sock: No such file or directory
說明:
mysqld.sock是mysql啟動以後自動生成的文件,關閉MySQL服務後,這個文件又會被刪除。如果MySQL啟動異常,就有可能不生成這個文件,登錄的時候就會出現你這個錯誤。
[[email protected] ~]# cd /var/lib/mysql
[[email protected] mysql]# ls
auto.cnf ib_logfile0 mysql01.err RPM_UPGRADE_MARKER-LAST
binarylog ib_logfile1 performance_schema test
ibdata1 mysql RPM_UPGRADE_HISTORY
[[email protected]