September 27, 2021

Homebrew Mariadb/MySQL fails to start - solution

mySQL/MariaDB on Homebrew Mac fails to start

Homebrew Mariadb/MySQL fails to start - solution

After upgrading to macOS Big Sur I got this message when trying to start up MariaDB:

Errors
$ brew services start mariadb Bootstrap failed: 5: Input/output error Error: Failure while executing; "/bin/launchctl bootstrap gui/501 /Users/my_user/Library/LaunchAgents/homebrew.mxcl.mariadb.plist" exited with 5.

Other errors from mysql.server start

./usr/local/bin/mysql.server: line 264: kill: (42609) - No such process

If I tried mysql -uroot -p

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Solution

  • Stop mySQL/MariaDB
  • Go to /usr/local/var/mysql
  • Delete ib_logfile0 and ib_logfile1 files
  • Start MariaDB/mySQL (mysql.server start in my case)