Home  >  Article  >  Database  >  How to solve the problem that MySQL cannot start after changing the host name in Linux

How to solve the problem that MySQL cannot start after changing the host name in Linux

WBOY
WBOYforward
2023-06-02 23:12:051105browse

MySQL cannot be restarted, cannot be shut down, cannot be started, or cannot be used. If it is because the host name has been modified, you can solve it like this: close all MySQL processes, and then start MySQL.

I saw that my host name was wrong today, so I changed it to distinguish the server. As a result, the following error occurred when I restarted mysql:

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

How can I find it? If you can’t find the PID, look at the following:

[root@linuxidc.com ~]#  ps aux | grep mysqlmysql    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

The original PID is still the original host name.pid, run:

kill -9  然后 service mysql start 哈哈看到绿色的OK了,

[root@linuxidc ~]# service mysql startStarting MySQL.                                            [ OK  ]

The above is the detailed content of How to solve the problem that MySQL cannot start after changing the host name in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete