2025-03-31 06:00:04

如何停止mysqld

要找到mysqld的开始命令(使用mac),我可以这样做:

ps aux|grep mysql

我得到以下输出,这允许我启动mysql服务器。

/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=...

如何从命令行中找到必要的命令来停止mysql ?


当前回答

/etc/init.d/mysql stop
service mysql stop
killall -KILL mysql mysqld_safe mysqld

When you see the following information, you success

mysql: no process found
mysqld_safe: no process found
mysqld: no process found

我用这个链接解决了在Ubuntu 15.10中安装MySQL 5.6的问题。

在这个安装过程中,我遇到了这样的问题:

"mysqld_safe A mysqld process already exists"

只要完全停止mysqld, mysqld_safe, mysql就解决问题了。

其他回答

我用下一个命令:

sudo killall mysqld

试着连杀mysqld四次。这是唯一对我有效的方法……

root@ubuntu:/etc/init# killall -KILL mysqld 
root@ubuntu:/etc/init# killall -KILL mysqld 
root@ubuntu:/etc/init# killall -KILL mysqld 
root@ubuntu:/etc/init# killall -KILL mysqld 
mysqld: no process found

只要不停地杀死它,直到你看到“mysqld: no process found”。

如果这些都失败了,这个能帮我。每次我试图在最后一次安装时杀死进程,它都会重生。

Sudo rm -rf /usr/local/var/mysql

重新安装mysql

以下是我在macbook pro上使用的方法:

停止mysql服务

如果你想停止所有的brew服务:

酿造服务全部停止

/etc/init.d/mysql stop
service mysql stop
killall -KILL mysql mysqld_safe mysqld

When you see the following information, you success

mysql: no process found
mysqld_safe: no process found
mysqld: no process found

我用这个链接解决了在Ubuntu 15.10中安装MySQL 5.6的问题。

在这个安装过程中,我遇到了这样的问题:

"mysqld_safe A mysqld process already exists"

只要完全停止mysqld, mysqld_safe, mysql就解决问题了。