Home > Database > Mysql Tutorial > 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
Release: 2023-06-02 23:12:05
forward
1162 people have browsed it

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]
Copy after login

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
Copy after login

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

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

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

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template