mysql server restart failed

I want to recover my mysql root password so I have followed this tutorial and stopped the mysql server . when I am trying to start it its show a error message and won’t start. I believe the error is due to read only file system.

  1. Is their any other way of restarting the mysql server
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#

NOTE: I am facing the readonly file system error which I have asked here .

Answer

umount, chkfs ?

mount -rw

First of all solve problem with filesystem, and start mysql only after that

Attribution
Source : Link , Question Author : Subhransu Mishra , Answer Author : Korjavin Ivan

Leave a Comment