Another macOS upgrade + another MySQL upgrade = another set of problems.
I can't seem to get MySQL 8.0.18 to run as a homebrew service on macOS 10.15 Catalina. Please show me the error of my ways.
Here's what I did:
- brew install mysql
- brew pin mysql
- touch /tmp/mysql.sock
- mysql.server start
- unset TMPDIR
- mysql_secure_installation
- mysql.server stop
- sudo brew services start mysql
Here's what I expected:
MySQL to run merrily along as a homebrew service as user root.
Here's what happened:
MySQL falls right over and dies, leaving a cryptic last statement in /usr/local/var/mysql/[host.domain.com].err
:
"[ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!"
Additional information:
MySQL runs fine through subsequent reboots so long as I launch it manually:
sudo reboot now
ssh [servername.domain.com]
touch /tmp/mysql.sock
mysql.server start
Here's the /usr/local/var/mysql/[servername.domain.com].err
file contents:
2019-10-20T18:02:14.6NZ mysqld_safe Logging to '/usr/local/var/mysql/moriarty.farces.com.err'.
2019-10-20T18:02:14.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-10-20T18:02:14.670494Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.18/bin/mysqld (mysqld 8.0.18) starting as process 557
2019-10-20T18:02:14.685511Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-10-20T18:02:15.617696Z 0 [System] [MY-010229] [Server] Starting crash recovery...
2019-10-20T18:02:15.626461Z 0 [System] [MY-010232] [Server] Crash recovery finished.
2019-10-20T18:02:15.795626Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-10-20T18:02:15.833541Z 0 [System] [MY-010931] [Server] /usr/local/Cellar/mysql/8.0.18/bin/mysqld: ready for connections. Version: '8.0.18' socket: '/tmp/mysql.sock' port: 3306 Homebrew.
2019-10-20T18:02:15.993739Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/tmp/mysqlx.sock' bind-address: '127.0.0.1' port: 33060
After a reboot, when I try to run MySQL as a Homebrew service:
sudo reboot now
ssh [servername.domain.com]
sudo brew services start mysql
MySQL fails with the following error recorded in the /usr/local/var/mysql/[servername.domain.com].err
file:
2019-10-20T18:44:13.780394Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2019-10-20T18:44:13.780503Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-10-20T18:44:13.780727Z 0 [System] [MY-010910] [Server] /usr/local/opt/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.18) Homebrew.
2019-10-20T18:44:13.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/moriarty.farces.com.pid ended