我想恢复我的 mysql root 密码,所以我按照本教程并停止了 mysql 服务器。当我尝试启动它时,它显示一条错误消息并且无法启动。我相信该错误是由于只读文件系统造成的。
- 还有其他方法可以重新启动 mysql 服务器吗
root@web01:/home/# /etc/init.d/mysql stop Stopping MySQL database server: mysqld ^Z [2]+ Stopped /etc/init.d/mysql stop root@web01:/home/# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) root@web01:/home/# root@web01:/home/# mysql -u root ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) root@web01:/home/# mysqld_safe --skip-grant-tables & [3] 7784 root@web01:/home/# 120830 08:20:56 mysqld_safe Logging to syslog. rm: cannot remove `/var/run/mysqld/mysqld.pid': Read-only file system 120830 08:20:57 mysqld_safe Fatal error: Can't remove the pid file: /var/run/mysqld/mysqld.pid Please remove it manually and start /usr/bin/mysqld_safe again; mysqld daemon not started [3] Exit 1 mysqld_safe --skip-grant-tables root@web01:/home/# mysql -u root ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) root@web01:/home/# /etc/init.d/mysqld start bash: /etc/init.d/mysqld: No such file or directory root@web01:/home# /etc/init.d/mysql start Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed! root@web01:/home# root@web01:/home# /etc/init.d/mysql start Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed! root@web01:/home# /etc/init.d/mysql restart Stopping MySQL database server: mysqld. Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed! root@web01:/home# ^C root@web01:/home#
注意:我遇到了只读文件系统错误,我曾问过这里 。
答案1
卸载,chkfs?
安装-rw
首先解决文件系统问题,然后再启动mysql