【发布时间】: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.
【问题讨论】: