输入:mysql提示:Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
无法启动mysql服务,通过在/ect/mysql/my.cnf 中 [mysqld] 字段写入
innodb_force_recovery = 6
即可启动mysql服务成功。
下面是命令过程:
root@bcvps:/var/run/mysqld# mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
root@bcvps:/var/run/mysqld# mysqld
root@bcvps:/var/run/mysqld# vi /etc/mysql/my.cnf
root@bcvps:/var/run/mysqld# service mysql start
mysql start/running, process 4455
root@bcvps:/var/run/mysqld# top
top – 12:08:49 up 1:29, 1 user, load average: 0.03, 0.07, 0.06
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7965 www-data 20 0 843448 120268 75896 S 0.0 11.9 0:01.86 apache2
7980 www-data 20 0 903532 116716 77692 S 0.0 11.5 0:02.70 apache2
7979 www-data 20 0 910576 104988 74932 S 0.0 10.3 0:00.99 apache2
4455 mysql 20 0 721836 97496 10936 S 0.0 9.6 0:03.47 mysqld