修改Linux主機名稱致MySQL無法啟動重啟

來源:互聯網
上載者:User

修改Linux主機名稱致MySQL無法啟動重啟

MySQL無法重啟、無法關閉、無法啟動、無法使用,如果是因為修改了主機名稱,可以這樣解決:關閉掉所有MySQL進程,然後在啟動一下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@bkjia.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@bkjia ~]# service mysql start
Starting MySQL.                                            [ OK  ]

本文永久更新連結地址:https://www.bkjia.com/Linux/2018-02/151070.htm

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.