-1

I use the command:

/usr/local/Cellar/mysql/5.6.26/support-files/mysql.server start

to start the database and get the error info:

ERROR! The server quit without updating PID file(/usr/local/var/mysql/macbooks-MacBook-Pro.local.pid).

The local.err has the following information:

151103 20:43:37 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2015-11-03 20:43:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-03 20:43:37 0 [Note] /usr/local/Cellar/mysql/5.6.26/bin/mysqld (mysqld 5.6.26) starting as process 42772 ...
2015-11-03 20:43:37 42772 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2015-11-03 20:43:37 42772 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/Cellar/mysql/5.6.26/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2015-11-03 20:43:37 42772 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
kindle11
  • 45
  • 2
  • 6

1 Answers1

1

Your MySQL installation appears to be damaged. You have an error but the proposed resolution isn't likely to help:

/usr/local/Cellar/mysql/5.6.26/bin/mysqld: Can't find file: './mysql   /plugin.frm'
(errno: 13 - Permission denied)
2015-11-03 20:43:37 42772 [ERROR] Can't open the mysql.plugin table.
Please run mysql_upgrade to create it.

As you see, MySQL cannot open a file, but not because it does not exist; rather because it has no rights to do so (error 13).

From the console, verify the status of the mysql/plugin.frm file in the 'mysql' directory. You'll need to find the MySQL data directory (mysql).

Supposing it's /usr/local/var/mysql/, you would do

ls -la /usr/local/var/mysql/ | more

(SPACE or ENTER to page the output) and see a row containing "plugin.frm".

If there is not, then running the mysql_upgrade command might fix things (but backup the mysql installation and data directory first! Just in case).

If there is, verify it has the same user and group as the other files. Chances are that the other files will be owned by Cellar/users and this, maybe, by root/wheel. As administrator (su), try running

chown Cellar:users ./mysql/plugin.frm

and this should fix the Errno 13, and possibly the PID trouble as well.

Failing everything else, reinstalling MySQL could be a solution. You'll install the same version 5.6.26, then verify the data directory and, if necessary, overwrite it with your backup, having care to preserve the new ownerships and permissions.

This trick isn't guaranteed to work between different MySQL versions and OSes, but on the same machine with the same MySQL version and OS it stands excellent chances.

You can also run a partial restore of only the databases you need (for example you can skip restoring the mysql tablespace where all users and permissions are. You'll lose them, but the data will still be accessible in the other databases).

Community
  • 1
  • 1
LSerni
  • 55,617
  • 10
  • 65
  • 107