Reputation: 411
I'am not able to get MySQL running after installation using Brew. I'am using OS X El Capitan Version 10.11.3 and MySQL Server version 5.7.11. When I start the server I receive:
Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Hedis-MacBook-Pro.local.pid).
and this what I get in my err file:
2016-03-19T20:59:45.907542Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
Does any one have got this before?
Many thanks.
Upvotes: 7
Views: 12756
Reputation: 7679
Brew now install mysql data to this folde: /usr/local/var/mysql/
I fixed the issue with the following:
cd /usr/local/var/mysql/
Make sure all files/folder under the above directory are owned by the right user and group. In my case, the user is me, za.
drwxr-x--- 77 za admin 2618 Jun 29 2016 mysql/
-rw-rw---- 1 za admin 5 Mar 13 11:03 mysqld_safe.pid
drwxr-x--- 90 za admin 3060 Jun 29 2016 performance_schema/
-rw------- 1 za admin 1676 Jun 29 2016 private_key.pem
-rw-r--r-- 1 za admin 452 Jun 29 2016 public_key.pem
-rw-r--r-- 1 za admin 1079 Jun 29 2016 server-cert.pem
-rw------- 1 za admin 1680 Jun 29 2016 server-key.pem
drwxr-x--- 108 za admin 3672 Jun 29 2016 sys/
-rw-r----- 1 _mysql admin 3672 Jun 29 2016 somehostname.xyz.org.err
The issue was that, this file (somehostname.xyz.org.err) was owned by _mysql, admin.
I deleted that one file and boom, mysql started successfully.
rm somehostname.xyz.org.err
za$ /usr/local/Cellar/mysql/5.7.22/bin/mysql.server start
Starting MySQL
SUCCESS!
za$ /usr/local/Cellar/mysql/5.7.22/bin/mysql.server status
SUCCESS! MySQL running (7625)
za$ /usr/local/Cellar/mysql/5.7.22/bin/mysql.server stop
Shutting down MySQL
.. SUCCESS!
In a different scenario, you may just need to alter ownership/permissions and not delete. Deleted mine because it is a file that will be re-created upon re-runing the service.
Upvotes: 0
Reputation: 99
I received this same error after updating homebrew.
To fix this I had to reset the owner of the mysql data dir, it was changed back to my userid after the update.
cd /usr/local/mysql
sudo chown -R _mysql data/
Assuming your mysql home dir is in /usr/local
After this a restart of the service worked
$ sudo /usr/local/mysql/support-files/mysql.server start
Starting MySQL
. SUCCESS!
Upvotes: 9