MySQL没法重启、没法关掉、无法启动、没法应用,假如是由于改动了主机名,能够 那样处理:关掉掉全部mysql过程,随后在起动一些mysql!

有时,要是实行以下MySQL复位指令就可以处理:/usr/local/mysql/bin/mysql_install_db--user=mysql

 

今日没事见到自身的主机名不对,因此改了一下,便于区别网络服务器,那只重启mysql时出現下边不正确:

MySQL manager or server PID file could not be found!       [FAILED]
Starting MySQL.Manager of pid-file quit without updating fi[FAILED]

为什么会找不着PID呢,看下面:

[root@daban114.com ~]#  ps aux | grep mysql
mysql    16433  0.0  0.2  36636  5756 ?        Sl   15:07   0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --log-error=/usr/local/mysql/var/hao9goAndSecondWeb.err --pid-file=/usr/local/mysql/var/hao9goAndSecondWeb.pid --socket=/tmp/mysql.sock --port=3306
root     16992  0.0  0.0   4020   704 pts/0    S    15:11   0:00 grep mysql

原先PID還是原先主机名.pid,运作:

kill -9 <mysqlpid> 随后 service mysql start 嘿嘿见到翠绿色的OK了,

[root@daban114 ~]# service mysql start
Starting MySQL.                                            [ OK  ]