mysql.server重新启动会显示错误消息

mysql.server重新启动会显示错误消息,mysql,homebrew,Mysql,Homebrew,当我尝试使用MySQL重新启动时,出现以下奇怪错误: $ sudo mysql.server stop Password: Shutting down MySQL .. SUCCESS! $ sudo mysql.server start Starting MySQL SUCCESS! $ sudo mysql.server restart Shutting down MySQL .. SUCCESS! Starting MySQL . ERROR! The server quit wi

当我尝试使用MySQL重新启动时,出现以下奇怪错误:

$ sudo mysql.server stop
Password:
Shutting down MySQL
.. SUCCESS! 
$ sudo mysql.server start
Starting MySQL
 SUCCESS! 
$ sudo mysql.server restart
Shutting down MySQL
.. SUCCESS! 
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/my.local.pid).
我在这里看到了答案:

但我得到以下错误:

$ mysql_install_db
FATAL ERROR: Could not find ./bin/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

有什么建议吗?

您可以尝试以下几点:

尝试直接重新启动: sudo/usr/local/mysql/support files/mysql.server重启

删除/etc/my.cnf或重命名它并重新启动: sudo mv/etc/my.cnf/etc/my.cnf.bak

sudomysql.server重启

删除任何.err文件或创建错误消息中提到的丢失的.pid。这一个对我有效 rm*.err/usr/local/mysql/data/

rm/usr/local/var/mysql/*.err

简单mysql重新安装
希望其中一个能帮到你

很可能是权限问题。尝试使用以下命令解决此问题:

$sudo chown\u mysql/usr/local/var/mysql/*

$sudo chown-R_mysql:_mysql/usr/local/var/mysql

也可能是mysql文件夹存在权限问题:

$sudo chmod-R 777/usr/local/var/mysql/