Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL 5.7.9 on OS X El Capitan: ERROR The server quit without updating the PID file

I have a Mac Pro Server with OS X Yosemite, a few days ago we made an upgrade to OS X El Capitan. The problem arise when I try to reinstall MySQL. I went to the official MySQL page and download the latest version (5.7.9) in a DMG package and installed it normally.
After install and reboot the server, the MySQL server didn't start automatically and when starting manually I get:

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

I've been trying lots of solutions over the internet:

After MySQL install via Brew, I get the error - The server quit without updating PID file

http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/

PID error on mysql.server start?

MySQL pid ended (cannot start mysql)

I tried to use the mysql.server restart, reboot the server. Remove *.err files and also I tried to create my own PID file but it were removed automatically.

A possible solution was completely uninstall MySQL and reinstall again: http://bytearrays.com/completely-uninstall-mysql-mac-osx/

Another one was to modify the .plist, but this files were identical to the solutions offered so it can not solve my problem.

And still I can't start MySQL server.

I think two possibilities: In one hand could be that I didn't uninstall completely MySQL and there is something doing bad thing and on the other hand is the ausence of the /etc/my.cnf file is the problem.

I've already been stuck for 2 days. I don't know what to do to run the server.

Edit 1: The output of executing sudo mysqld --user=mysql is:

simidat-apps:~ admin$ sudo mysqld --user=mysql
Password:
2015-11-18  9:08:36 140735160397824 [Note] mysqld (mysqld 10.1.8-MariaDB) starting as process 81030 ...
2015-11-18  9:08:36 140735160397824 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2015-11-18  9:08:36 140735160397824 [ERROR] mysqld: File '/usr/local/var/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2015-11-18  9:08:36 140735160397824 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/usr/local/var/mysql/aria_log_control'
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'Aria' init function returned error.
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Memory barrier is not used
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Compressed tables use zlib 1.2.5
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Using CPU crc32 instructions
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Completed initialization of buffer pool
2015-11-18  9:08:36 140735160397824 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2015-11-18  9:08:36 140735160397824 [ERROR] InnoDB: The system tablespace must be writable!
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'InnoDB' init function returned error.
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-11-18  9:08:36 140735160397824 [Note] Plugin 'FEEDBACK' is disabled.
2015-11-18  9:08:36 140735160397824 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2015-11-18  9:08:36 140735160397824 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-11-18  9:08:36 140735160397824 [ERROR] Aborting

I forget to put this error at the initial question, it seems like an error on InnoDB (I don't know what it is and if someone can explain me what it is I will be very thankful). Also I looked for this error over the internet, I don't remember where I saw the solution, but I have to remove every InnoDB log file (ib*files) and surprisingly I can't find any log file so I couldn't remove anything. I think it could be a permission problems, but what permissions to what user?

like image 445
Ángel Miguel García Vico Avatar asked Nov 17 '15 22:11

Ángel Miguel García Vico


People also ask

Do you already have another mysqld server running on port 3306?

You could use netstat -lp | grep 3306 to find out what program is already listening on port 3306 (you should see PID/Program name in last column) and stop that (maybe mysql is already running?).


2 Answers

Your issue is not actually Mysql, but rather with MariaDB's scheme. The issue is the permissions on the aria_log_control file.

I installed mysql / mariadb via brew, and thus I:

  1. reset perms to 775 (sudo chmod 775/usr/local/var/mysql/aria_log_control`)
  2. deleted the log file (e.g. rm /usr/local/var/mysql/*.home.err)
  3. start/stop the mysqld

Other sources claim that you need to remove the mysql dir. This wasn't the case for me.

like image 96
New Alexandria Avatar answered Sep 26 '22 14:09

New Alexandria


The other thing to check is that the permissions on all the parent directories above the mysql data directory are correct.

For ex. check that permissions on /var are correct, and permissions on /var/lib/ are correct.

In my case my /var permissions were messed up, and the user "mysql" was not able to access the var directory at all.

One way to sanity check this is to switch to a regular user, and make sure the regular user can cd to /var and to /var/lib (assuming mysql data dir is inside /var/lib).

like image 41
Eduard Rozenberg Avatar answered Sep 25 '22 14:09

Eduard Rozenberg