2
votes

Several problems with mysql since last Sierra Update. Reinstalled several times with brew or mysql dmg and followd many many "solutions" on SO.

Finally it worked but after a Mac Crash, I face the same problem.

  • MySql won't start from preference panel
  • Mysql won't start from terminal: Can't connect through /tmp/mysql.sock...of course, mysqld is not running
  • trying to start mysqld:

    sudo /usr/local/mysql/support-files/mysql.server start

    ERROR! The server quit without updating PID file (/usr/local/mysql/data/My-iMac.local.pid)

    sudo /usr/local/mysql/bin/mysqld several errors and shutdown

a bit stuck

3

3 Answers

6
votes

Just tried this

sudo /usr/local/mysql/bin/mysqld_safe
mysqld_safe Logging to '/usr/local/mysql/data/My-iMac.local.err'.
Starting mysqld daemon with databases from /usr/local/mysql/data
mysqld_safe mysqld from pid file /usr/local/mysql/data/My-iMac.local.pid ended

And now looking at error log, the explanation is clear:

tail /usr/local/mysql/data/My-iMac.local.err
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.   

So I added in my.cnf

[mysqld]
innodb_force_recovery = 1

and now it starts!

It was probably due to previous Mac Crash

3
votes

In my case the owner of the data folder was changed after an OS update.

After fixing this with …

sudo chown -R mysql /usr/local/mysql/data

… everything worked like a charm again.

-1
votes

Oh, I feel your pain. I've had this happen many times. Stopping the processes didn't always work. To solve this I simply went into System Preferences and MySQL... stop the process from there and try to restart.