【问题标题】:mysql.server restart gives error messagemysql.server restart 给出错误信息
【发布时间】:2015-06-22 01:07:53
【问题描述】:

当我尝试使用 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).

我在这里看了答案:PID error on mysql.server start?

但我收到以下错误:

$ 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.

有什么建议吗?

【问题讨论】:

    标签: mysql homebrew


    【解决方案1】:

    你可以尝试几件事:

    • 尝试直接重启:

    sudo /usr/local/mysql/support-files/mysql.server restart

    • 删除 /etc/my.cnf(或重命名)并重新启动:

    sudo mv /etc/my.cnf /etc/my.cnf.bak

    sudo mysql.server restart

    • 删除所有 .err 文件或创建错误消息中提到的缺失 .pid(这个对我有用)

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

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

    • 简单的mysql重装

    希望其中一个能帮到你!

    【讨论】:

      【解决方案2】:

      这很可能是权限问题。尝试用这个命令解决它:

      $ sudo chown _mysql /usr/local/var/mysql/*

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

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

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

      【讨论】:

        猜你喜欢
        • 2016-12-06
        • 2016-08-23
        • 2012-11-11
        • 1970-01-01
        • 2016-03-12
        • 1970-01-01
        • 2011-05-25
        • 1970-01-01
        相关资源
        最近更新 更多