简体   繁体   中英

Unable to start mysql server on mac for mysql@5.6

I am trying to set up mysql@5.6 on my mac. I had multiple versions of mysql in my local, I removed all of them, installed mysql@5.6 by following these steps as per this post: 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

I did not have any my.cnf file inside /etc , so I created this with following content:

 [mysqld]
 bind-address = 127.0.0.1

Now while doing mysql.server start , getting following error:

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

I checked the log file, I am seeing following error:

   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

Then I followed this post: Can't open the mysql.plugin table. Please run mysql_upgrade to create it , and run following command:

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

But still I am seeing the same error.

EDIT:

I have found my.cnf file, it was located inside /usr/local/etc/

I removed mysqlx-bind-address, now I am getting following errors:

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.

I have solved this running following command:

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

I got this idea from here: https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks

Then with mysql.server start , mysql DB server is getting up without any error. Thanks.

Just solved this problem on my system. Turns out, the problematic line ( mysqlx-bind-address=127.0.0.1 ) was in /usr/local/etc/my.cnf , while everyone just says to check /etc/my.cnf .

After removing the offending file (probably a leftover from MySQL 8 install), MySQL 5.6 install worked fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM