1

Background

I'm essentially having this error Table 'mysql.user' doesn't exist:ERROR after moving my databases between computers, among other information, hoping it would not have any problem loading the database. This is probably a closer error message: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

I found this error in the MySQL logs that are found by my GUI client Mysql Workbench.

2016-06-09 10:02:30, 11690, ERROR, Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

I don't have a mysql_install_db, and my PATH includes /usr/local/mysql/bin. I'm on a Mac, and trying to use MySQL 5.6 as I was before on the old computer. I had probably started it through the MySQL PreferencePane, but that is now not working.

Commands such as mysqladmin debug and mysqladmin reload don't work, as I am unable to start the server with this similar error message.

Question

I don't want to re-initialize the tables, as I want to keep the data that is there. How can I go about this?

Data

> ls /usr/local/mysql/data/ -al
total 112740
drwxr-xr-x 15 _mysql _mysql      510 Jun  9 11:15 ./
drwxr-xr-x 16 root   wheel       544 Feb 28 21:16 ../
drwx------  2 _mysql _mysql       68 May 17 19:54 _development/
drwx------  2 _mysql _mysql       68 Jun  7 16:53 _test/
drwx------  2 _mysql _mysql       68 May 12 20:03 _test2/
drwx------  2 _mysql _mysql       68 May 12 20:03 _test3/
drwx------  2 _mysql _mysql       68 May 12 20:03 _test4/
-rw-rw----  1 _mysql _mysql       56 Jun  8 13:54 auto.cnf
drwx------  2 _mysql _mysql       68 Mar  4 14:33 geo/
-rw-rw----  1 _mysql _mysql 50331648 Jun  9 11:15 ib_logfile0
-rw-rw----  1 _mysql _mysql 50331648 Jun  8 13:54 ib_logfile1
-rw-rw----  1 _mysql _mysql 12582912 Jun  8 13:54 ibdata1
drwx------  2 _mysql _mysql       68 Feb 28 21:16 mysql/
-rw-rw----  1 _mysql _mysql  2194429 Jun  9 11:15 mysqld.local.err
drwx------  2 _mysql _mysql       68 Feb 28 21:16 performance_schema/

> ls /usr/local/var/mysql/ -al
total 110632
drwxr-xr-x  18 username admin      612 Feb 22 09:49 ./
drwxr-xr-x  10 username admin      340 Apr 19 13:15 ../
-rw-r-----   1 username admin       56 Feb 22 09:49 auto.cnf
-rw-------   1 username admin     1676 Feb 22 09:49 ca-key.pem
-rw-r--r--   1 username admin     1075 Feb 22 09:49 ca.pem
-rw-r--r--   1 username admin     1079 Feb 22 09:49 client-cert.pem
-rw-------   1 username admin     1676 Feb 22 09:49 client-key.pem
-rw-r-----   1 username admin      408 Feb 22 09:49 ib_buffer_pool
-rw-r-----   1 username admin 50331648 Feb 22 09:49 ib_logfile0
-rw-r-----   1 username admin 50331648 Feb 22 09:49 ib_logfile1
-rw-r-----   1 username admin 12582912 Feb 22 09:49 ibdata1
drwxr-x---  77 username admin     2618 Feb 22 09:49 mysql/
drwxr-x---  90 username admin     3060 Feb 22 09:49 performance_schema/
-rw-------   1 username admin     1676 Feb 22 09:49 private_key.pem
-rw-r--r--   1 username admin      452 Feb 22 09:49 public_key.pem
-rw-r--r--   1 username admin     1079 Feb 22 09:49 server-cert.pem
-rw-------   1 username admin     1680 Feb 22 09:49 server-key.pem
drwxr-x--- 108 username admin     3672 Feb 22 09:49 sys/

> ls /usr/local/var/mysql/mysql/ -al
total 11880
drwxr-x--- 77 username admin    2618 Feb 22 09:49 ./
drwxr-xr-x 18 username admin     612 Feb 22 09:49 ../

... tons of MYD, MYI, frm, opt, ibd, csm, csv files, about 70+ of them.

MySQL Install DB Command

/u/l/mysql-5.6.29-osx10.8-x86_64 > sudo /usr/local/mysql/scripts/mysql_install_db
Installing MySQL system tables...2016-06-09 13:55:05 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-06-09 13:55:05 0 [Note] ./bin/mysqld (mysqld 5.6.29) starting as process 4284 ...
2016-06-09 13:55:05 4284 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-06-09 13:55:05 4284 [Note] InnoDB: The InnoDB memory heap is disabled
2016-06-09 13:55:05 4284 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-06-09 13:55:05 4284 [Note] InnoDB: Memory barrier is not used
2016-06-09 13:55:05 4284 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-06-09 13:55:05 4284 [Note] InnoDB: Using CPU crc32 instructions
2016-06-09 13:55:05 4284 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-06-09 13:55:05 4284 [Note] InnoDB: Completed initialization of buffer pool
2016-06-09 13:55:05 4284 [Note] InnoDB: Highest supported file format is Barracuda.
2016-06-09 13:55:05 4284 [Note] InnoDB: 128 rollback segment(s) are active.
2016-06-09 13:55:05 4284 [Note] InnoDB: Waiting for purge to start
2016-06-09 13:55:05 4284 [Note] InnoDB: 5.6.29 started; log sequence number 1600637
2016-06-09 13:55:06 4284 [Note] Binlog end
2016-06-09 13:55:06 4284 [Note] InnoDB: FTS optimize thread exiting.
2016-06-09 13:55:06 4284 [Note] InnoDB: Starting shutdown...
2016-06-09 13:55:07 4284 [Note] InnoDB: Shutdown completed; log sequence number 1626017
OK

Filling help tables...2016-06-09 13:55:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-06-09 13:55:07 0 [Note] ./bin/mysqld (mysqld 5.6.29) starting as process 4286 ...
2016-06-09 13:55:07 4286 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-06-09 13:55:07 4286 [Note] InnoDB: The InnoDB memory heap is disabled
2016-06-09 13:55:07 4286 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-06-09 13:55:07 4286 [Note] InnoDB: Memory barrier is not used
2016-06-09 13:55:07 4286 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-06-09 13:55:07 4286 [Note] InnoDB: Using CPU crc32 instructions
2016-06-09 13:55:07 4286 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-06-09 13:55:07 4286 [Note] InnoDB: Completed initialization of buffer pool
2016-06-09 13:55:07 4286 [Note] InnoDB: Highest supported file format is Barracuda.
2016-06-09 13:55:07 4286 [Note] InnoDB: 128 rollback segment(s) are active.
2016-06-09 13:55:07 4286 [Note] InnoDB: Waiting for purge to start
2016-06-09 13:55:07 4286 [Note] InnoDB: 5.6.29 started; log sequence number 1626017
2016-06-09 13:55:07 4286 [Note] Binlog end
2016-06-09 13:55:07 4286 [Note] InnoDB: FTS optimize thread exiting.
2016-06-09 13:55:07 4286 [Note] InnoDB: Starting shutdown...
2016-06-09 13:55:09 4286 [Note] InnoDB: Shutdown completed; log sequence number 1626027
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h hostname password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file ./my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as ./my-new.cnf,
please compare it with your file and take the changes you need.

/u/l/mysql-5.6.29-osx10.8-x86_64 > ./bin/mysqladmin -u root password
New password:
Confirm new password:
/u/l/mysql-5.6.29-osx10.8-x86_64 > ls
COPYING  README  bin/  data/  docs/  include/  lib/  man/  my-new.cnf  my.cnf  mysql-test/  scripts/  share/  sql-bench/  support-files/
/u/l/mysql-5.6.29-osx10.8-x86_64 > diff -u my.cnf my-new.cnf

Configuration

> sudo cat /usr/local/mysql-5.6.29-osx10.8-x86_64/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Starting the Server

> sudo cat "/usr/local/mysql/data/mysqld.local.err"
2016-06-09 14:40:41 6554 [Note] Plugin 'FEDERATED' is disabled.
2016-06-09 14:40:41 6554 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-06-09 14:40:41 6554 [Note] InnoDB: The InnoDB memory heap is disabled
2016-06-09 14:40:41 6554 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-06-09 14:40:41 6554 [Note] InnoDB: Memory barrier is not used
2016-06-09 14:40:41 6554 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-06-09 14:40:41 6554 [Note] InnoDB: Using CPU crc32 instructions
2016-06-09 14:40:41 6554 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-06-09 14:40:41 6554 [Note] InnoDB: Completed initialization of buffer pool
2016-06-09 14:40:41 6554 [Note] InnoDB: Highest supported file format is Barracuda.
2016-06-09 14:40:41 6554 [Note] InnoDB: 128 rollback segment(s) are active.
2016-06-09 14:40:41 6554 [Note] InnoDB: Waiting for purge to start
2016-06-09 14:40:41 6554 [Note] InnoDB: 5.6.29 started; log sequence number 1626047
2016-06-09 14:40:41 6554 [Note] Server hostname (bind-address): '*'; port: 3306
2016-06-09 14:40:41 6554 [Note] IPv6 is available.
2016-06-09 14:40:41 6554 [Note]   - '::' resolves to '::';
2016-06-09 14:40:41 6554 [Note] Server socket created on IP: '::'.
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/cond_instances.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_current.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_history.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_history_long.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_summary_by_host_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_host_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_summary_by_instance.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_summary_by_thread_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_summary_by_user_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_user_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_summary_by_account_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_account_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_waits_summary_global_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/file_instances.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/file_summary_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/file_summary_by_instance.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/host_cache.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'host_cache' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/mutex_instances.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/objects_summary_global_by_type.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'objects_summary_global_by_type' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/performance_timers.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/rwlock_instances.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/setup_actors.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'setup_actors' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/setup_consumers.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/setup_instruments.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/setup_objects.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'setup_objects' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/setup_timers.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/table_io_waits_summary_by_index_usage.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_index_usage' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/table_io_waits_summary_by_table.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'table_io_waits_summary_by_table' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/table_lock_waits_summary_by_table.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'table_lock_waits_summary_by_table' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/threads.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_current.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_current' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_history.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_history' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_history_long.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_history_long' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_summary_by_thread_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_thread_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_summary_by_account_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_account_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_summary_by_user_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_user_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_summary_by_host_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_summary_by_host_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_stages_summary_global_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_stages_summary_global_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_current.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_current' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_history.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_history' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_history_long.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_history_long' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_summary_by_thread_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_thread_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_summary_by_account_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_account_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_summary_by_user_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_user_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_summary_by_host_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_host_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_summary_global_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_summary_global_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/events_statements_summary_by_digest.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_digest' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/users.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'users' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/accounts.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/hosts.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/socket_instances.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/socket_summary_by_instance.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/socket_summary_by_event_name.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/session_connect_attrs.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'session_connect_attrs' has the wrong structure
2016-06-09 14:40:41 6554 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './performance_schema/session_account_connect_attrs.frm' (errno: 13 - Permission denied)
2016-06-09 14:40:41 6554 [ERROR] Native table 'performance_schema'.'session_account_connect_attrs' has the wrong structure
2016-06-09 14:40:41 6554 [Note] Event Scheduler: Loaded 0 events
2016-06-09 14:40:41 6554 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.6.29'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)

Start-up log after chown

2016-06-09 15:04:49 7788 [Note] Plugin 'FEDERATED' is disabled.
2016-06-09 15:04:49 7788 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-06-09 15:04:49 7788 [Note] InnoDB: The InnoDB memory heap is disabled
2016-06-09 15:04:49 7788 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-06-09 15:04:49 7788 [Note] InnoDB: Memory barrier is not used
2016-06-09 15:04:49 7788 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-06-09 15:04:49 7788 [Note] InnoDB: Using CPU crc32 instructions
2016-06-09 15:04:49 7788 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-06-09 15:04:49 7788 [Note] InnoDB: Completed initialization of buffer pool
2016-06-09 15:04:49 7788 [Note] InnoDB: Highest supported file format is Barracuda.
2016-06-09 15:04:49 7788 [Note] InnoDB: 128 rollback segment(s) are active.
2016-06-09 15:04:49 7788 [Note] InnoDB: Waiting for purge to start
2016-06-09 15:04:49 7788 [Note] InnoDB: 5.6.29 started; log sequence number 1626057
2016-06-09 15:04:49 7788 [Note] Server hostname (bind-address): '*'; port: 3306
2016-06-09 15:04:49 7788 [Note] IPv6 is available.
2016-06-09 15:04:49 7788 [Note]   - '::' resolves to '::';
2016-06-09 15:04:49 7788 [Note] Server socket created on IP: '::'.
2016-06-09 15:04:49 7788 [Note] Event Scheduler: Loaded 0 events
2016-06-09 15:04:49 7788 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.6.29'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)
Pysis
  • 1,452
  • 2
  • 17
  • 31
  • 2
    You need the `mysql_install_db` script for repair. Should be in `/usr/local/mysql-VERSION/scripts/`. http://serverfault.com/questions/273416/where-can-i-find-mysql-install-db-for-mac http://stackoverflow.com/questions/17601341/mysql-install-db-cannot-find-file Did you install from package or compile yourself? – BitAccesser Jun 09 '16 at 16:10
  • Found the command and tried it with `sudo`; no options. I installed from the official pkg file for Mac from the MySQL website I believe. After some InnoDB messages and mysqld starting, I can connect to it, see my databases, but there are no tables there =/. – Pysis Jun 09 '16 at 18:05
  • You ran it from the folder? Show the messages at startup. – BitAccesser Jun 09 '16 at 18:06
  • Show config file and error logs. – BitAccesser Jun 09 '16 at 18:16
  • Seems you need some `options` of `mysql_install_db`.https://dev.mysql.com/doc/refman/5.6/en/mysql-install-db.html Use `--verbose` to show more infos and i think you need to use `--datadir` to point to your database. Did you edit the config file? – BitAccesser Jun 09 '16 at 18:37
  • Sorry about the wait. It seems I did not have the usual `/var/db/mysql` or `/var/log/mysql` directories, but found it in the same folder, under the data directory as `mysqld.local.err`. Also, starting it through Workbench doesn't seem to generate any of those files, so I went back to using the PreferencePane. I'm trying to use default directories, and was hoping it would find them without error. – Pysis Jun 09 '16 at 18:44
  • I actually just followed this Q&A (https://unix.stackexchange.com/questions/157461/mysql-startup-errors-error-1005) to some success, chown'd the data directory recursively for the `_mysql` user. Log is much cleaner now, but still no tables :(. – Pysis Jun 09 '16 at 19:07
  • 1
    Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/114272/discussion-between-pysis-and-bitaccesser). – Pysis Jun 09 '16 at 19:09

0 Answers0