【问题标题】:Unable to start mysql server on mac for mysql@5.6无法在 mac 上为 mysql@5.6 启动 mysql 服务器
【发布时间】:2021-04-04 22:46:59
【问题描述】:

我正在尝试在我的 Mac 上设置 mysql@5.6。我的本地有多个版本的 mysql,我删除了所有版本,按照这篇文章按照以下步骤安装了 mysql@5.6:After MySQL install via Brew, I get the error - The server quit without updating PID file:

brew remove mysql
brew cleanup
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /usr/local/var/mysql

brew install mysql@5.6

ln -s /usr/local/Cellar/mysql\@5.6/5.6.47/bin/mysql /usr/local/bin/mysql

我在/etc 中没有任何my.cnf 文件,所以我创建了以下内容:

 [mysqld]
 bind-address = 127.0.0.1

现在在执行 mysql.server start 时,出现以下错误:

... ERROR! The server quit without updating PID file (/usr/local/var/mysql/my.pid).

我检查了日志文件,我看到以下错误:

   2020-04-28 11:17:49 48498 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/opt/mysql@5.6/bin/mysqld: Table 'mysql.plugin' doesn't exist
2020-04-28 11:17:49 48498 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2020-04-28 11:17:49 48498 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-04-28 11:17:49 48498 [Note] InnoDB: The InnoDB memory heap is disabled
2020-04-28 11:17:49 48498 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-04-28 11:17:49 48498 [Note] InnoDB: Memory barrier is not used
2020-04-28 11:17:49 48498 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-04-28 11:17:49 48498 [Note] InnoDB: Using CPU crc32 instructions
2020-04-28 11:17:49 48498 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2020-04-28 11:17:49 48498 [Note] InnoDB: Completed initialization of buffer pool
2020-04-28 11:17:49 48498 [Note] InnoDB: Highest supported file format is Barracuda.
2020-04-28 11:17:49 48498 [Note] InnoDB: 128 rollback segment(s) are active.
2020-04-28 11:17:49 48498 [Note] InnoDB: Waiting for purge to start
2020-04-28 11:17:49 48498 [Note] InnoDB: 5.6.47 started; log sequence number 1603477
2020-04-28 11:17:49 48498 [ERROR] /usr/local/opt/mysql@5.6/bin/mysqld: unknown variable 'mysqlx-bind-address=127.0.0.1'
2020-04-28 11:17:49 48498 [ERROR] Aborting

然后我关注了这个帖子:Can't open the mysql.plugin table. Please run mysql_upgrade to create it,并运行以下命令:

  /usr/local/Cellar/mysql\@5.6/5.6.47/bin/mysqld --initialize-insecure

但我仍然看到同样的错误。

编辑:

我找到了 my.cnf 文件,它位于 /usr/local/etc/ 中

我删除了 mysqlx-bind-address,现在我收到以下错误:

2020-04-28 14:16:13 97501 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2020-04-28 14:16:35 98713 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

【问题讨论】:

    标签: mysql macos mysql-5.6


    【解决方案1】:

    刚刚在我的系统上解决了这个问题。原来,有问题的行(mysqlx-bind-address=127.0.0.1)在/usr/local/etc/my.cnf,而每个人都只是说检查/etc/my.cnf

    删除有问题的文件(可能是 MySQL 8 安装的剩余文件)后,MySQL 5.6 安装工作正常。

    【讨论】:

      【解决方案2】:

      我已经解决了这个运行以下命令:

      mysql_install_db --verbose --user=`whoami` --basedir=/usr/local/Cellar/mysql\@5.6/5.6.47 --datadir=/usr/local/var/mysql --tmpdir=/tmp
      

      我从这里得到了这个想法:https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks

      然后使用mysql.server start,mysql DB 服务器正在启动,没有任何错误。谢谢。

      【讨论】:

        猜你喜欢
        • 2019-07-18
        • 2018-09-28
        • 1970-01-01
        • 2013-12-08
        • 2021-10-18
        • 2021-10-24
        • 1970-01-01
        • 2015-01-21
        • 2017-05-09
        相关资源
        最近更新 更多