无法在mac上启动mysql服务器[email protected]

问题描述 投票:0回答:1

我想在mac上设置[email protected]。我的本地有多个版本的mysql,我把它们都删除了,按照这个帖子的步骤安装了[email protected]在通过Brew安装MySQL后,我得到了一个错误 - 服务器没有更新PID文件就退出了。:

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 [email protected]

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

我没有 my.cnf 文件夹 /etc所以我用以下内容创建了这个。

 [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/[email protected]/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/[email protected]/bin/mysqld: unknown variable 'mysqlx-bind-address=127.0.0.1'
2020-04-28 11:17:49 48498 [ERROR] Aborting

然后,我按照这个帖子。无法打开mysql.plugin表。请运行mysql_upgrade来创建它。并运行以下命令。

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

但我还是看到同样的错误。

编辑:我找到了my.cnf文件,它位于usrlocaletc内。

我找到了my.cnf文件,它位于usrlocaletc里面。

我删除了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个回答
0
投票

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

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.compos6woquninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks。

然后与 mysql.server start,mysql DB服务器起来了,没有任何错误。谢谢。

© www.soinside.com 2019 - 2024. All rights reserved.