最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Mac中启动mysql出错:ERROR The server quit without updating PID file

Mac crifan 4629浏览 0评论

折腾:

【已解决】Mac中dmg安装mysql后登录出错:ERROR 2002 HY000 Can’t connect to local MySQL server through socket /tmp/mysql.sock 61

期间,mac中尝试启动mysql,结果出错:

<code>➜  ~ /usr/local/mysql/support-files/mysql.server status
 ERROR! MySQL is not running
➜  ~ /usr/local/mysql/support-files/mysql.server start
Starting MySQL
./usr/local/mysql/bin/mysqld_safe: line 647: /usr/local/mysql/data/promote.cache-dns.local.err: Permission denied
Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
/usr/local/mysql/bin/mysqld_safe: line 144: /usr/local/mysql/data/promote.cache-dns.local.err: Permission denied
/usr/local/mysql/bin/mysqld_safe: line 198: /usr/local/mysql/data/promote.cache-dns.local.err: Permission denied
/usr/local/mysql/bin/mysqld_safe: line 906: /usr/local/mysql/data/promote.cache-dns.local.err: Permission denied
rm: /usr/local/mysql/data/promote.cache-dns.local.pid.shutdown: Permission denied
/usr/local/mysql/bin/mysqld_safe: line 144: /usr/local/mysql/data/promote.cache-dns.local.err: Permission denied
 ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
</code>

mysql.server start mysqld_safe promote.cache-dns.local.err: Permission denied

mysql server start ERROR! The server quit without updating PID file

MySql 启动报错:The server quit without updating PID file 如何解决 – CSDN博客

<code>➜  ~ sudo ls -lha /usr/local/mysql/data/
total 221200
drwxr-x---   10 _mysql  _mysql   320B  4 27 11:53 .
drwxr-xr-x   13 root    wheel    416B  4 27 11:53 ..
-rw-r-----    1 _mysql  _mysql    56B  4 27 11:52 auto.cnf
-rw-r-----    1 _mysql  _mysql   417B  4 27 11:52 ib_buffer_pool
-rw-r-----    1 _mysql  _mysql    48M  4 27 11:53 ib_logfile0
-rw-r-----    1 _mysql  _mysql    48M  4 27 11:52 ib_logfile1
-rw-r-----    1 _mysql  _mysql    12M  4 27 11:53 ibdata1
drwxr-x---   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxr-x---   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
drwxr-x---  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  ~ sudo ls -lha /usr/local/mysql/
total 48
drwxr-xr-x  13 root    wheel    416B  4 27 11:53 .
drwxr-xr-x  30 root    wheel    960B  4 27 11:52 ..
-rw-r--r--   1 root    wheel     18K  3  4 21:40 COPYING
-rw-r--r--   1 root    wheel    2.4K  3  4 21:40 README
drwxr-xr-x  40 root    wheel    1.3K  3  4 23:25 bin
drwxr-x---  10 _mysql  _mysql   320B  4 27 11:53 data
drwxr-xr-x   5 root    wheel    160B  3  4 23:24 docs
drwxr-xr-x  50 root    wheel    1.6K  3  4 23:24 include
drwxr-x---   2 _mysql  _mysql    64B  4 27 11:53 keyring
drwxr-xr-x  11 root    wheel    352B  4 27 11:52 lib
drwxr-xr-x   4 root    wheel    128B  3  4 23:24 man
drwxr-xr-x  39 root    wheel    1.2K  3  4 23:24 share
drwxr-xr-x   6 root    wheel    192B  3  4 23:24 support-files
</code>

去chmod 755

<code>➜  ~ sudo ls -lha /usr/local/mysql/
total 48
drwxr-xr-x  13 root    wheel    416B  4 27 11:53 .
drwxr-xr-x  30 root    wheel    960B  4 27 11:52 ..
-rw-r--r--   1 root    wheel     18K  3  4 21:40 COPYING
-rw-r--r--   1 root    wheel    2.4K  3  4 21:40 README
drwxr-xr-x  40 root    wheel    1.3K  3  4 23:25 bin
drwxr-xr-x  10 _mysql  _mysql   320B  4 27 11:53 data
drwxr-xr-x   5 root    wheel    160B  3  4 23:24 docs
drwxr-xr-x  50 root    wheel    1.6K  3  4 23:24 include
drwxr-x---   2 _mysql  _mysql    64B  4 27 11:53 keyring
drwxr-xr-x  11 root    wheel    352B  4 27 11:52 lib
drwxr-xr-x   4 root    wheel    128B  3  4 23:24 man
drwxr-xr-x  39 root    wheel    1.2K  3  4 23:24 share
drwxr-xr-x   6 root    wheel    192B  3  4 23:24 support-files
</code>

错误依旧。

MySQL启动报【The server quit without updating PID file】错误的解决过程 – CSDN博客

MySql server startup error ‘The server quit without updating PID file ‘ – Stack Overflow

<code>➜  ~ sudo chown -R mysql /usr/local/mysql/data/
➜  ~ ll /usr/local/mysql/data/
total 221200
-rw-r-----    1 _mysql  _mysql    56B  4 27 11:52 auto.cnf
-rw-r-----    1 _mysql  _mysql   417B  4 27 11:52 ib_buffer_pool
-rw-r-----    1 _mysql  _mysql    48M  4 27 11:53 ib_logfile0
-rw-r-----    1 _mysql  _mysql    48M  4 27 11:52 ib_logfile1
-rw-r-----    1 _mysql  _mysql    12M  4 27 11:53 ibdata1
drwxr-x---   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxr-x---   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
drwxr-x---  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  ~ ll /usr/local/mysql/
total 48
-rw-r--r--   1 root    wheel     18K  3  4 21:40 COPYING
-rw-r--r--   1 root    wheel    2.4K  3  4 21:40 README
drwxr-xr-x  40 root    wheel    1.3K  3  4 23:25 bin
drwxr-xr-x  10 _mysql  _mysql   320B  4 27 11:53 data
drwxr-xr-x   5 root    wheel    160B  3  4 23:24 docs
drwxr-xr-x  50 root    wheel    1.6K  3  4 23:24 include
drwxr-x---   2 _mysql  _mysql    64B  4 27 11:53 keyring
drwxr-xr-x  11 root    wheel    352B  4 27 11:52 lib
drwxr-xr-x   4 root    wheel    128B  3  4 23:24 man
drwxr-xr-x  39 root    wheel    1.2K  3  4 23:24 share
drwxr-xr-x   6 root    wheel    192B  3  4 23:24 support-files
➜  ~ chmod 777 /usr/local/mysql/data/
chmod: Unable to change file mode on /usr/local/mysql/data/: Operation not permitted
➜  ~ sudo chmod 777 /usr/local/mysql/data/
➜  ~ ll /usr/local/mysql/
total 48
-rw-r--r--   1 root    wheel     18K  3  4 21:40 COPYING
-rw-r--r--   1 root    wheel    2.4K  3  4 21:40 README
drwxr-xr-x  40 root    wheel    1.3K  3  4 23:25 bin
drwxrwxrwx  10 _mysql  _mysql   320B  4 27 11:53 data
drwxr-xr-x   5 root    wheel    160B  3  4 23:24 docs
drwxr-xr-x  50 root    wheel    1.6K  3  4 23:24 include
drwxr-x---   2 _mysql  _mysql    64B  4 27 11:53 keyring
drwxr-xr-x  11 root    wheel    352B  4 27 11:52 lib
drwxr-xr-x   4 root    wheel    128B  3  4 23:24 man
drwxr-xr-x  39 root    wheel    1.2K  3  4 23:24 share
drwxr-xr-x   6 root    wheel    192B  3  4 23:24 support-files
</code>

结果强制删除了,还是出错:

<code>➜  ~ /usr/local/mysql/support-files/mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
➜  ~ sudo rm -f /usr/local/mysql/data/promote.cache-dns.local.pid
➜  ~ /usr/local/mysql/support-files/mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
</code>

mac mysql ERROR! The server quit without updating PID file

homebrew – After MySQL install via Brew, I get the error – The server quit without updating PID file – Stack Overflow

macbook下启动mysql报错 . ERROR! The server quit without updating PID file – CSDN博客

<code>➜  ~ cd /usr/local/mysql/
➜  mysql git:(master) ✗ ll
total 48
-rw-r--r--   1 root    wheel     18K  3  4 21:40 COPYING
-rw-r--r--   1 root    wheel    2.4K  3  4 21:40 README
drwxr-xr-x  40 root    wheel    1.3K  3  4 23:25 bin
drwxrwxrwx  11 _mysql  _mysql   352B  4 27 13:44 data
drwxr-xr-x   5 root    wheel    160B  3  4 23:24 docs
drwxr-xr-x  50 root    wheel    1.6K  3  4 23:24 include
drwxr-x---   2 _mysql  _mysql    64B  4 27 11:53 keyring
drwxr-xr-x  11 root    wheel    352B  4 27 11:52 lib
drwxr-xr-x   4 root    wheel    128B  3  4 23:24 man
drwxr-xr-x  39 root    wheel    1.2K  3  4 23:24 share
drwxr-xr-x   6 root    wheel    192B  3  4 23:24 support-files
➜  mysql git:(master) ✗ cd data
➜  data git:(master) ✗ ls -lha
total 221216
drwxrwxrwx   11 _mysql  _mysql   352B  4 27 13:44 .
drwxr-xr-x   13 root    wheel    416B  4 27 11:53 ..
-rw-r-----    1 _mysql  _mysql    56B  4 27 11:52 auto.cnf
-rw-r-----    1 _mysql  _mysql   417B  4 27 11:52 ib_buffer_pool
-rw-r-----    1 _mysql  _mysql    48M  4 27 11:53 ib_logfile0
-rw-r-----    1 _mysql  _mysql    48M  4 27 11:52 ib_logfile1
-rw-r-----    1 _mysql  _mysql    12M  4 27 11:53 ibdata1
drwxr-x---   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxr-x---   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
-rw-r-----    1 crifan  _mysql   4.6K  4 27 13:44 promote.cache-dns.local.err
drwxr-x---  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗ cat promote.cache-dns.local.err
2018-04-27T05:43:50.6NZ mysqld_safe Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
2018-04-27T05:43:50.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2018-04-27T05:43:50.820031Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T05:43:50.820879Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T05:43:50.821748Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.22) starting as process 71005 ...
2018-04-27T05:43:50.835355Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2018-04-27T05:43:50.841115Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-27T05:43:50.841170Z 0 [Note] InnoDB: Uses event mutexes
2018-04-27T05:43:50.841184Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-27T05:43:50.841196Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-27T05:43:50.842631Z 0 [Note] InnoDB: Number of pools: 1
2018-04-27T05:43:50.844959Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-27T05:43:50.848003Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-27T05:43:50.864444Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-27T05:43:50.880332Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2018-04-27T05:43:50.880436Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2018-04-27T05:43:50.880552Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-04-27T05:43:51.182575Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-04-27T05:43:51.182617Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-04-27T05:43:51.182632Z 0 [ERROR] Failed to initialize builtin plugins.
2018-04-27T05:43:51.182643Z 0 [ERROR] Aborting

2018-04-27T05:43:51.182689Z 0 [Note] Binlog end
2018-04-27T05:43:51.183342Z 0 [Note] Shutting down plugin 'CSV'
2018-04-27T05:43:51.184451Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

2018-04-27T05:43:51.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/promote.cache-dns.local.pid ended
2018-04-27T05:44:12.6NZ mysqld_safe Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
2018-04-27T05:44:12.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2018-04-27T05:44:12.640541Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T05:44:12.640793Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T05:44:12.640848Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.22) starting as process 71127 ...
2018-04-27T05:44:12.644431Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2018-04-27T05:44:12.646337Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-27T05:44:12.646374Z 0 [Note] InnoDB: Uses event mutexes
2018-04-27T05:44:12.646388Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-27T05:44:12.646400Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-27T05:44:12.646753Z 0 [Note] InnoDB: Number of pools: 1
2018-04-27T05:44:12.646900Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-27T05:44:12.648525Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-27T05:44:12.660434Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-27T05:44:12.673798Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2018-04-27T05:44:12.673881Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2018-04-27T05:44:12.673933Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-04-27T05:44:12.979786Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-04-27T05:44:12.979852Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-04-27T05:44:12.979874Z 0 [ERROR] Failed to initialize builtin plugins.
2018-04-27T05:44:12.979890Z 0 [ERROR] Aborting

2018-04-27T05:44:12.979916Z 0 [Note] Binlog end
2018-04-27T05:44:12.980044Z 0 [Note] Shutting down plugin 'CSV'
2018-04-27T05:44:12.980510Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

2018-04-27T05:44:13.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/promote.cache-dns.local.pid ended
➜  data git:(master) ✗
</code>

好好看看日志

错误是

<code>[ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
</code>

Mysql服务启动错误 The server quit without updating PID file | 记录点滴成长

[ERROR] InnoDB: The innodb_system data file ‘ibdata1’ must be writable

【问题解决】MYSQL 服务无法启动,错误日志:InnoDB: .\ibdata1 must be writable – CSDN博客

<code>➜  data git:(master) ✗ sudo chmod 777 *
➜  data git:(master) ✗ ll
total 221216
-rwxrwxrwx    1 _mysql  _mysql    56B  4 27 11:52 auto.cnf
-rwxrwxrwx    1 _mysql  _mysql   417B  4 27 11:52 ib_buffer_pool
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 11:53 ib_logfile0
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 11:52 ib_logfile1
-rwxrwxrwx    1 _mysql  _mysql    12M  4 27 11:53 ibdata1
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
-rwxrwxrwx    1 _mysql  _mysql   4.6K  4 27 13:44 promote.cache-dns.local.err
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗ pwd
/usr/local/mysql/data
➜  data git:(master) ✗ rm promote.cache-dns.local.err
➜  data git:(master) ✗ ll
total 221200
-rw-r-----    1 crifan  _mysql    56B  4 27 13:53 auto.cnf
-rw-r-----    1 crifan  _mysql   255B  4 27 13:53 ib_buffer_pool
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 13:53 ib_logfile0
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 11:52 ib_logfile1
-rwxrwxrwx    1 _mysql  _mysql    12M  4 27 13:53 ibdata1
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗
➜  data git:(master) ✗ ../support-files/mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
➜  data git:(master) ✗ ll
total 221256
-rw-r-----    1 crifan  _mysql    56B  4 27 13:53 auto.cnf
-rw-r-----    1 crifan  _mysql   255B  4 27 13:53 ib_buffer_pool
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 13:53 ib_logfile0
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 11:52 ib_logfile1
-rwxrwxrwx    1 _mysql  _mysql    12M  4 27 13:53 ibdata1
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
-rw-r-----    1 crifan  _mysql    25K  4 27 13:53 promote.cache-dns.local.err
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗ cat promote.cache-dns.local.err
2018-04-27T05:53:26.6NZ mysqld_safe Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
2018-04-27T05:53:26.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2018-04-27T05:53:26.965474Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T05:53:26.965780Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T05:53:26.965847Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.22) starting as process 71991 ...
2018-04-27T05:53:26.971426Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2018-04-27T05:53:26.973615Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-27T05:53:26.973658Z 0 [Note] InnoDB: Uses event mutexes
2018-04-27T05:53:26.973671Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-27T05:53:26.973683Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-27T05:53:26.974052Z 0 [Note] InnoDB: Number of pools: 1
2018-04-27T05:53:26.974194Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-27T05:53:26.976243Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-27T05:53:26.990360Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-27T05:53:27.012424Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-04-27T05:53:27.031557Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2018-04-27T05:53:27.031590Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-04-27T05:53:27.031606Z 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/engine_cost.ibd' OS error: 81
2018-04-27T05:53:27.031620Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2018-04-27T05:53:27.031632Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-04-27T05:53:27.031647Z 0 [ERROR] InnoDB: Could not find a valid tablespace file for `mysql/engine_cost`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
。。。
2018-04-27T05:53:27.033876Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-04-27T05:53:27.033992Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-27T05:53:27.055678Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-04-27T05:53:27.056928Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-04-27T05:53:27.056978Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-04-27T05:53:27.057383Z 0 [Note] InnoDB: Waiting for purge to start
2018-04-27T05:53:27.112790Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 2589175
2018-04-27T05:53:27.113205Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T05:53:27.113417Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-04-27T05:53:27.113666Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180427 13:53:27
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2018-04-27T05:53:27.113807Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
mysqld: Can't find file: './mysql/gtid_executed.frm' (errno: 13 - Permission denied)
2018-04-27T05:53:27.115205Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-04-27T05:53:27.115395Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-04-27T05:53:27.122588Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-04-27T05:53:27.122701Z 0 [Note] IPv6 is available.
2018-04-27T05:53:27.122729Z 0 [Note]   - '::' resolves to '::';
2018-04-27T05:53:27.122810Z 0 [Note] Server socket created on IP: '::'.
2018-04-27T05:53:27.122905Z 0 [ERROR] Could not open unix socket lock file /tmp/mysql.sock.lock.
2018-04-27T05:53:27.122918Z 0 [ERROR] Unable to setup unix socket lock file.
2018-04-27T05:53:27.122928Z 0 [ERROR] Aborting

2018-04-27T05:53:27.122943Z 0 [Note] Binlog end
2018-04-27T05:53:27.122999Z 0 [Note] Shutting down plugin 'ngram'
2018-04-27T05:53:27.123015Z 0 [Note] Shutting down plugin 'partition'
2018-04-27T05:53:27.123025Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2018-04-27T05:53:27.123035Z 0 [Note] Shutting down plugin 'ARCHIVE'
2018-04-27T05:53:27.123044Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2018-04-27T05:53:27.123089Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2018-04-27T05:53:27.123102Z 0 [Note] Shutting down plugin 'MyISAM'
2018-04-27T05:53:27.123139Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2018-04-27T05:53:27.123150Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2018-04-27T05:53:27.123159Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2018-04-27T05:53:27.123168Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2018-04-27T05:53:27.123176Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2018-04-27T05:53:27.123185Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2018-04-27T05:53:27.123193Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2018-04-27T05:53:27.123202Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2018-04-27T05:53:27.123211Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2018-04-27T05:53:27.123219Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2018-04-27T05:53:27.123228Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2018-04-27T05:53:27.123236Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2018-04-27T05:53:27.123245Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2018-04-27T05:53:27.123253Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2018-04-27T05:53:27.123262Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2018-04-27T05:53:27.123270Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2018-04-27T05:53:27.123279Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2018-04-27T05:53:27.123287Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2018-04-27T05:53:27.123296Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2018-04-27T05:53:27.123304Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2018-04-27T05:53:27.123313Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2018-04-27T05:53:27.123321Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2018-04-27T05:53:27.123330Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2018-04-27T05:53:27.123338Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2018-04-27T05:53:27.123347Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2018-04-27T05:53:27.123355Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2018-04-27T05:53:27.123387Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2018-04-27T05:53:27.123397Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2018-04-27T05:53:27.123406Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-04-27T05:53:27.123415Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-04-27T05:53:27.123423Z 0 [Note] Shutting down plugin 'InnoDB'
2018-04-27T05:53:27.123472Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-04-27T05:53:27.123565Z 0 [Note] InnoDB: Starting shutdown...
2018-04-27T05:53:27.223842Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T05:53:27.224410Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180427 13:53:27
2018-04-27T05:53:28.581145Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2589210
2018-04-27T05:53:28.582508Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-04-27T05:53:28.582540Z 0 [Note] Shutting down plugin 'MEMORY'
2018-04-27T05:53:28.582552Z 0 [Note] Shutting down plugin 'CSV'
2018-04-27T05:53:28.582563Z 0 [Note] Shutting down plugin 'sha256_password'
2018-04-27T05:53:28.582571Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-04-27T05:53:28.582687Z 0 [Note] Shutting down plugin 'binlog'
2018-04-27T05:53:28.582846Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

2018-04-27T05:53:28.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/promote.cache-dns.local.pid ended
</code>

 

Cannot open datafile for read-only: ‘./mysql/engine_cost.ibd’ OS error: 81

mysql Cannot open datafile for read-only: ‘./mysql/engine_cost.ibd’ OS error: 81

mac Cannot open datafile for read-only: ‘./mysql/engine_cost.ibd’ OS error: 81

MySQL :: MySQL 8.0 Reference Manual :: 15.20.3 Troubleshooting InnoDB Data Dictionary Operations

MySQL :: Re: Lost connection MySQL server at 'reading initial'

service – Could not start MySQL server in WAMP – Stack Overflow

<code>➜  data git:(master) ✗ rm promote.cache-dns.local.err
➜  data git:(master) ✗ ll
total 221200
-rw-r-----    1 crifan  _mysql    56B  4 27 13:53 auto.cnf
-rw-r-----    1 crifan  _mysql   255B  4 27 13:53 ib_buffer_pool
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 13:53 ib_logfile0
-rwxrwxrwx    1 _mysql  _mysql    48M  4 27 11:52 ib_logfile1
-rwxrwxrwx    1 _mysql  _mysql    12M  4 27 13:53 ibdata1
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗ rm ibdata1
➜  data git:(master) ✗ rm ib_logfile*
➜  data git:(master) ✗ ll
total 16
-rw-r-----    1 crifan  _mysql    56B  4 27 13:53 auto.cnf
-rw-r-----    1 crifan  _mysql   255B  4 27 13:53 ib_buffer_pool
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗ ../support-files/mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
➜  data git:(master) ✗

➜  data git:(master) ✗ cat promote.cache-dns.local.err
2018-04-27T06:02:11.6NZ mysqld_safe Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
2018-04-27T06:02:11.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2018-04-27T06:02:12.046572Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T06:02:12.047638Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T06:02:12.048391Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.22) starting as process 72537 ...
2018-04-27T06:02:12.060721Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2018-04-27T06:02:12.067303Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-27T06:02:12.067358Z 0 [Note] InnoDB: Uses event mutexes
2018-04-27T06:02:12.067373Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-27T06:02:12.067387Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-27T06:02:12.069206Z 0 [Note] InnoDB: Number of pools: 1
2018-04-27T06:02:12.071741Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-27T06:02:12.073586Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-27T06:02:12.086825Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-27T06:02:12.100938Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2018-04-27T06:02:12.101596Z 0 [Note] InnoDB: Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-27T06:02:12.122592Z 0 [Note] InnoDB: File './ibdata1' size is now 12 MB.
2018-04-27T06:02:12.124508Z 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2018-04-27T06:02:12.190953Z 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2018-04-27T06:02:12.270658Z 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-04-27T06:02:12.270893Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-04-27T06:02:12.270942Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-04-27T06:02:12.271049Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-27T06:02:12.289140Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-04-27T06:02:12.289383Z 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2018-04-27T06:02:12.299882Z 0 [Note] InnoDB: Doublewrite buffer created
2018-04-27T06:02:12.307903Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-04-27T06:02:12.307946Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-04-27T06:02:12.308233Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-04-27T06:02:12.312300Z 0 [Note] InnoDB: Foreign key constraint system tables created
2018-04-27T06:02:12.312373Z 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2018-04-27T06:02:12.312752Z 0 [Note] InnoDB: Tablespace and datafile system tables created.
2018-04-27T06:02:12.312788Z 0 [Note] InnoDB: Creating sys_virtual system tables.
2018-04-27T06:02:12.313059Z 0 [Note] InnoDB: sys_virtual table created
2018-04-27T06:02:12.313271Z 0 [Note] InnoDB: Waiting for purge to start
2018-04-27T06:02:12.367933Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 0
2018-04-27T06:02:12.369854Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2018-04-27T06:02:12.372723Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
mysqld: Can't find file: './mysql/gtid_executed.frm' (errno: 13 - Permission denied)
2018-04-27T06:02:12.377951Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-04-27T06:02:12.379828Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-04-27T06:02:12.386628Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-04-27T06:02:12.386745Z 0 [Note] IPv6 is available.
2018-04-27T06:02:12.386772Z 0 [Note]   - '::' resolves to '::';
2018-04-27T06:02:12.386845Z 0 [Note] Server socket created on IP: '::'.
2018-04-27T06:02:12.386936Z 0 [ERROR] Could not open unix socket lock file /tmp/mysql.sock.lock.
2018-04-27T06:02:12.386948Z 0 [ERROR] Unable to setup unix socket lock file.
2018-04-27T06:02:12.386957Z 0 [ERROR] Aborting

2018-04-27T06:02:12.386987Z 0 [Note] Binlog end
2018-04-27T06:02:12.387088Z 0 [Note] Shutting down plugin 'ngram'
2018-04-27T06:02:12.387117Z 0 [Note] Shutting down plugin 'partition'
2018-04-27T06:02:12.387128Z 0 [Note] Shutting down plugin 'BLACKHOLE'
。。。
2018-04-27T06:02:12.387866Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-04-27T06:02:12.387875Z 0 [Note] Shutting down plugin 'InnoDB'
2018-04-27T06:02:12.387954Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-04-27T06:02:12.388054Z 0 [Note] InnoDB: Starting shutdown...
2018-04-27T06:02:12.492836Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T06:02:12.493897Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180427 14:02:12
2018-04-27T06:02:13.837696Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1209961
2018-04-27T06:02:13.839171Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-04-27T06:02:13.839249Z 0 [Note] Shutting down plugin 'MEMORY'
2018-04-27T06:02:13.839271Z 0 [Note] Shutting down plugin 'CSV'
2018-04-27T06:02:13.839289Z 0 [Note] Shutting down plugin 'sha256_password'
2018-04-27T06:02:13.839304Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-04-27T06:02:13.839454Z 0 [Note] Shutting down plugin 'binlog'
2018-04-27T06:02:13.839740Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

2018-04-27T06:02:13.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/promote.cache-dns.local.pid ended

➜  data git:(master) ✗ cat auto.cnf
[auto]
server-uuid=41008148-49df-11e8-87e4-26cd906d71ef
➜  data git:(master) ✗ ll
total 221224
-rw-r-----    1 crifan  _mysql    56B  4 27 13:53 auto.cnf
-rw-r-----    1 crifan  _mysql   215B  4 27 14:02 ib_buffer_pool
-rw-r-----    1 crifan  _mysql    48M  4 27 14:02 ib_logfile0
-rw-r-----    1 crifan  _mysql    48M  4 27 14:02 ib_logfile1
-rw-r-----    1 crifan  _mysql    12M  4 27 14:02 ibdata1
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
-rw-r-----    1 crifan  _mysql   8.6K  4 27 14:02 promote.cache-dns.local.err
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗ cat mysql/
➜  data git:(master) ✗ ll mysql
total 23936
-rw-r-----  1 _mysql  _mysql     0B  4 27 11:52 columns_priv.MYD
-rw-r-----  1 _mysql  _mysql   4.0K  4 27 11:52 columns_priv.MYI
。。。
-rw-r-----  1 _mysql  _mysql   8.5K  4 27 11:52 time_zone_transition_type.frm
-rw-r-----  1 _mysql  _mysql    96K  4 27 11:52 time_zone_transition_type.ibd
-rw-r-----  1 _mysql  _mysql   384B  4 27 11:52 user.MYD
-rw-r-----  1 _mysql  _mysql   4.0K  4 27 11:52 user.MYI
-rw-r-----  1 _mysql  _mysql    11K  4 27 11:52 user.frm
</code>

-rw-r—–  1 _mysql  _mysql   8.4K  4 27 11:52 plugin.frm

所以,干脆,把所有的目录的权限,都弄成777,估计就可以了。

<code>➜  data git:(master) ✗ pwd
/usr/local/mysql/data
➜  data git:(master) ✗ sudo chmod -R 777 /usr/local/mysql/data
Password:
➜  data git:(master) ✗ ll
total 221224
-rwxrwxrwx    1 crifan  _mysql    56B  4 27 13:53 auto.cnf
-rwxrwxrwx    1 crifan  _mysql   215B  4 27 14:02 ib_buffer_pool
-rwxrwxrwx    1 crifan  _mysql    48M  4 27 14:02 ib_logfile0
-rwxrwxrwx    1 crifan  _mysql    48M  4 27 14:02 ib_logfile1
-rwxrwxrwx    1 crifan  _mysql    12M  4 27 14:02 ibdata1
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
-rwxrwxrwx    1 crifan  _mysql   8.6K  4 27 14:02 promote.cache-dns.local.err
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  data git:(master) ✗ ll mysql
total 23936
-rwxrwxrwx  1 _mysql  _mysql     0B  4 27 11:52 columns_priv.MYD
-rwxrwxrwx  1 _mysql  _mysql   4.0K  4 27 11:52 columns_priv.MYI
-rwxrwxrwx  1 _mysql  _mysql   8.6K  4 27 11:52 columns_priv.frm
-rwxrwxrwx  1 _mysql  _mysql   976B  4 27 11:52 db.MYD
-rwxrwxrwx  1 _mysql  _mysql   5.0K  4 27 11:52 db.MYI
-rwxrwxrwx  1 _mysql  _mysql   9.4K  4 27 11:52 db.frm
-rwxrwxrwx  1 _mysql  _mysql    65B  4 27 11:52 db.opt
-rwxrwxrwx  1 _mysql  _mysql   8.6K  4 27 11:52 engine_cost.frm
-rwxrwxrwx  1 _mysql  _mysql    96K  4 27 11:52 engine_cost.ibd
-rwxrwxrwx  1 _mysql  _mysql     0B  4 27 11:52 event.MYD
-rwxrwxrwx  1 _mysql  _mysql   2.0K  4 27 11:52 event.MYI
。。。
-rwxrwxrwx  1 _mysql  _mysql   8.5K  4 27 11:52 time_zone_transition_type.frm
-rwxrwxrwx  1 _mysql  _mysql    96K  4 27 11:52 time_zone_transition_type.ibd
-rwxrwxrwx  1 _mysql  _mysql   384B  4 27 11:52 user.MYD
-rwxrwxrwx  1 _mysql  _mysql   4.0K  4 27 11:52 user.MYI
-rwxrwxrwx  1 _mysql  _mysql    11K  4 27 11:52 user.frm
</code>

还是出错:

<code>➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
</code>

再去试试:

<code>➜  AliyunRdsMysql rm /usr/local/mysql/data/promote.cache-dns.local.err
➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
➜  AliyunRdsMysql cat /usr/local/mysql/data/promote.cache-dns.local.err
2018-04-27T06:07:51.6NZ mysqld_safe Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
2018-04-27T06:07:51.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2018-04-27T06:07:51.647066Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T06:07:51.647491Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T06:07:51.647573Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.22) starting as process 73121 ...
2018-04-27T06:07:51.653446Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2018-04-27T06:07:51.656260Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-27T06:07:51.656321Z 0 [Note] InnoDB: Uses event mutexes
2018-04-27T06:07:51.656343Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-27T06:07:51.656363Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-27T06:07:51.656916Z 0 [Note] InnoDB: Number of pools: 1
2018-04-27T06:07:51.657108Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-27T06:07:51.659648Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-27T06:07:51.677006Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-27T06:07:51.687678Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-04-27T06:07:51.699288Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-04-27T06:07:51.699442Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-27T06:07:51.721524Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-04-27T06:07:51.722869Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-04-27T06:07:51.722921Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-04-27T06:07:51.723477Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 1209980
2018-04-27T06:07:51.723657Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T06:07:51.723909Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-04-27T06:07:51.725184Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180427 14:07:51
2018-04-27T06:07:51.730375Z 0 [Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.plugin' doesn't exist
2018-04-27T06:07:51.730519Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2018-04-27T06:07:51.734147Z 0 [Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.gtid_executed' doesn't exist
2018-04-27T06:07:51.734242Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-04-27T06:07:51.734410Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-04-27T06:07:51.743650Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-04-27T06:07:51.743775Z 0 [Note] IPv6 is available.
2018-04-27T06:07:51.743813Z 0 [Note]   - '::' resolves to '::';
2018-04-27T06:07:51.743893Z 0 [Note] Server socket created on IP: '::'.
2018-04-27T06:07:51.743985Z 0 [ERROR] Could not open unix socket lock file /tmp/mysql.sock.lock.
2018-04-27T06:07:51.743999Z 0 [ERROR] Unable to setup unix socket lock file.
2018-04-27T06:07:51.744010Z 0 [ERROR] Aborting

2018-04-27T06:07:51.744026Z 0 [Note] Binlog end
2018-04-27T06:07:51.744085Z 0 。。。
2018-04-27T06:07:51.744466Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-04-27T06:07:51.744473Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-04-27T06:07:51.744481Z 0 [Note] Shutting down plugin 'InnoDB'
2018-04-27T06:07:51.744526Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-04-27T06:07:51.744585Z 0 [Note] InnoDB: Starting shutdown...
2018-04-27T06:07:51.845294Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T06:07:51.846212Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180427 14:07:51
2018-04-27T06:07:53.188918Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1209999
2018-04-27T06:07:53.190076Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-04-27T06:07:53.190101Z 0 [Note] Shutting down plugin 'MEMORY'
2018-04-27T06:07:53.190113Z 0 [Note] Shutting down plugin 'CSV'
2018-04-27T06:07:53.190123Z 0 [Note] Shutting down plugin 'sha256_password'
2018-04-27T06:07:53.190132Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-04-27T06:07:53.190248Z 0 [Note] Shutting down plugin 'binlog'
2018-04-27T06:07:53.190396Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

2018-04-27T06:07:53.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/promote.cache-dns.local.pid ended
</code>

2018-04-27T06:07:51.730375Z 0 [Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.

mysqld: Table ‘mysql.plugin’ doesn’t exist

2018-04-27T06:07:51.730519Z 0 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.

所以去试试:

mac mysql mysql_upgrade

Mac OSX下的MySQL数据库升级 – 个人文章 – SegmentFault 思否

MAC下升级MySQL数据库 – CSDN博客

<code>➜  AliyunRdsMysql mysql_upgrade -u root -p
Enter password:
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
</code>

mysql_upgrade: Got error: 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock

Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) – Stack Overflow

Bug #1605948 “mysql_upgrade: Got error: 2002: Can’t connect to l…” : Bugs : mysql-5.7 package : Ubuntu

<code>➜  AliyunRdsMysql mysqladmin -u root -p status
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
➜  AliyunRdsMysql mysqld
2018-04-27T06:14:35.320433Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T06:14:35.323200Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T06:14:35.324381Z 0 [Note] mysqld (mysqld 5.7.22) starting as process 73445 ...
2018-04-27T06:14:35.342472Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ is case insensitive
2018-04-27T06:14:35.347568Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-27T06:14:35.347594Z 0 [Note] InnoDB: Uses event mutexes
2018-04-27T06:14:35.347599Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-27T06:14:35.347604Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-27T06:14:35.350951Z 0 [Note] InnoDB: Number of pools: 1
2018-04-27T06:14:35.354947Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-27T06:14:35.358249Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-27T06:14:35.375919Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-27T06:14:35.413636Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-04-27T06:14:35.438415Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-04-27T06:14:35.438577Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-27T06:14:35.464628Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-04-27T06:14:35.465620Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-04-27T06:14:35.465634Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-04-27T06:14:35.466154Z 0 [Note] InnoDB: Waiting for purge to start
2018-04-27T06:14:35.519535Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 1209999
2018-04-27T06:14:35.521378Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T06:14:35.523654Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180427 14:14:35
2018-04-27T06:14:35.523689Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-04-27T06:14:35.533671Z 0 [Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.plugin' doesn't exist
2018-04-27T06:14:35.534457Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2018-04-27T06:14:35.541980Z 0 [Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.gtid_executed' doesn't exist
2018-04-27T06:14:35.542025Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-04-27T06:14:35.543799Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-04-27T06:14:35.551699Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-04-27T06:14:35.551832Z 0 [Note] IPv6 is available.
2018-04-27T06:14:35.551861Z 0 [Note]   - '::' resolves to '::';
2018-04-27T06:14:35.551947Z 0 [Note] Server socket created on IP: '::'.
2018-04-27T06:14:35.552296Z 0 [ERROR] Could not remove unix socket lock file /tmp/mysql.sock.lock.
2018-04-27T06:14:35.552306Z 0 [ERROR] Unable to setup unix socket lock file.
2018-04-27T06:14:35.552310Z 0 [ERROR] Aborting

2018-04-27T06:14:35.552339Z 0 [Note] Binlog end
2018-04-27T06:14:35.552684Z 。。。
2018-04-27T06:14:35.559397Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2018-04-27T06:14:35.559402Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2018-04-27T06:14:35.559502Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-04-27T06:14:35.559515Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2018-04-27T06:14:35.559522Z 0 [Note] Shutting down plugin 'InnoDB'
2018-04-27T06:14:35.559642Z 0 [Note] InnoDB: FTS optimize thread exiting.
2018-04-27T06:14:35.559704Z 0 [Note] InnoDB: Starting shutdown...
2018-04-27T06:14:35.662393Z 0 [Note] InnoDB: Dumping buffer pool(s) to /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T06:14:35.663330Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 180427 14:14:35
2018-04-27T06:14:36.905091Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1210018
2018-04-27T06:14:36.906339Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-04-27T06:14:36.906362Z 0 [Note] Shutting down plugin 'MEMORY'
2018-04-27T06:14:36.906367Z 0 [Note] Shutting down plugin 'CSV'
2018-04-27T06:14:36.906372Z 0 [Note] Shutting down plugin 'sha256_password'
2018-04-27T06:14:36.906375Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-04-27T06:14:36.906520Z 0 [Note] Shutting down plugin 'binlog'
2018-04-27T06:14:36.906823Z 0 [Note] mysqld: Shutdown complete
</code>

[ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.

Can’t open the mysql.plugin table. Please run mysql – CSDN博客

<code>➜  AliyunRdsMysql ll /usr/local/mysql/data
total 221216
-rw-r-----    1 crifan  _mysql    56B  4 27 14:06 auto.cnf
-rw-r-----    1 crifan  _mysql   185B  4 27 14:14 ib_buffer_pool
-rwxrwxrwx    1 crifan  _mysql    48M  4 27 14:14 ib_logfile0
-rwxrwxrwx    1 crifan  _mysql    48M  4 27 14:02 ib_logfile1
-rwxrwxrwx    1 crifan  _mysql    12M  4 27 14:14 ibdata1
drwxrwxrwx   77 _mysql  _mysql   2.4K  4 27 11:52 mysql
drwxrwxrwx   90 _mysql  _mysql   2.8K  4 27 11:52 performance_schema
-rw-r-----    1 crifan  _mysql   7.9K  4 27 14:07 promote.cache-dns.local.err
drwxrwxrwx  108 _mysql  _mysql   3.4K  4 27 11:52 sys
➜  AliyunRdsMysql mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
2018-04-27 14:16:59 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2018-04-27 14:16:59 [ERROR]   The data directory '/usr/local/mysql/data' already exist and is not empty.
➜  AliyunRdsMysql mysqld --initialize
2018-04-27T06:17:21.220947Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T06:17:21.233447Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2018-04-27T06:17:21.233504Z 0 [ERROR] Aborting

➜  AliyunRdsMysql rm -rf /usr/local/mysql/data
rm: /usr/local/mysql/data: Permission denied
➜  AliyunRdsMysql sudo rm -rf /usr/local/mysql/data
➜  AliyunRdsMysql mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
2018-04-27 14:18:05 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
mysql_install_db: Can't create directory '/usr/local/mysql/data' (Errcode: 13 - Permission denied)
2018-04-27 14:18:05 [ERROR]   Failed to create the data directory '/usr/local/mysql/data'
➜  AliyunRdsMysql mkdir /usr/local/mysql/data
mkdir: /usr/local/mysql/data: Permission denied
➜  AliyunRdsMysql sudo mkdir /usr/local/mysql/data
➜  AliyunRdsMysql sudo chmod 777 /usr/local/mysql/data
➜  AliyunRdsMysql mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
2018-04-27 14:18:36 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2018-04-27 14:18:41 [WARNING] The bootstrap log isn't empty:
2018-04-27 14:18:41 [WARNING] 2018-04-27T06:18:36.462515Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server status
 ERROR! MySQL is not running
➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server status
 ERROR! MySQL is not running
➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
➜  AliyunRdsMysql ll /usr/local/mysql/data/promote.cache-dns.local.err
-rw-r-----  1 crifan  wheel   7.2K  4 27 14:19 /usr/local/mysql/data/promote.cache-dns.local.err
➜  AliyunRdsMysql sudo rm -f /usr/local/mysql/data/promote.cache-dns.local.err
➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
➜  AliyunRdsMysql sudo chmod -R 777 /usr/local/mysql/data
➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/promote.cache-dns.local.pid).
➜  AliyunRdsMysql cat /usr/local/mysql/data/promote.cache-dns.local.err
2018-04-27T06:19:56.6NZ mysqld_safe Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
2018-04-27T06:19:56.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2018-04-27T06:19:57.023577Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T06:19:57.024977Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T06:19:57.026391Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.22) starting as process 73973 ...
2018-04-27T06:19:57.040313Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2018-04-27T06:19:57.049581Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-27T06:19:57.049629Z 0 [Note] InnoDB: Uses event mutexes
2018-04-27T06:19:57.049647Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-04-27T06:19:57.049660Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-27T06:19:57.052354Z 0 [Note] InnoDB: Number of pools: 1
2018-04-27T06:19:57.054985Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-04-27T06:19:57.057859Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-04-27T06:19:57.075771Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-04-27T06:19:57.104637Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-04-27T06:19:57.132898Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-04-27T06:19:57.133032Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-04-27T06:19:57.158364Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-04-27T06:19:57.159264Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-04-27T06:19:57.159287Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-04-27T06:19:57.159671Z 0 [Note] InnoDB: Waiting for purge to start
2018-04-27T06:19:57.214092Z 0 [Note] InnoDB: 5.7.22 started; log sequence number 2589175
2018-04-27T06:19:57.214817Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/mysql-5.7.22-macos10.13-x86_64/data/ib_buffer_pool
2018-04-27T06:19:57.216848Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-04-27T06:19:57.228362Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180427 14:19:57
2018-04-27T06:19:57.236859Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-04-27T06:19:57.240203Z 0 [Warning] CA certificate ca.pem is self signed.
2018-04-27T06:19:57.248786Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-04-27T06:19:57.248915Z 0 [Note] IPv6 is available.
2018-04-27T06:19:57.248952Z 0 [Note]   - '::' resolves to '::';
2018-04-27T06:19:57.249026Z 0 [Note] Server socket created on IP: '::'.
2018-04-27T06:19:57.249411Z 0 [ERROR] Could not remove unix socket lock file /tmp/mysql.sock.lock.
2018-04-27T06:19:57.249438Z 0 [ERROR] Unable to setup unix socket lock file.
2018-04-27T06:19:57.249451Z 0 [ERROR] Aborting

2018-04-27T06:19:57.249486Z 0 [Note] Binlog end
2018-04-27T06:19:57.249827Z 0 [Note] Shutting down plugin 'ngram'
。。。
2018-04-27T06:19:58.682177Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2589210
2018-04-27T06:19:58.683813Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-04-27T06:19:58.683853Z 0 [Note] Shutting down plugin 'MEMORY'
2018-04-27T06:19:58.683866Z 0 [Note] Shutting down plugin 'CSV'
2018-04-27T06:19:58.683877Z 0 [Note] Shutting down plugin 'sha256_password'
2018-04-27T06:19:58.683886Z 0 [Note] Shutting down plugin 'mysql_native_password'
2018-04-27T06:19:58.684017Z 0 [Note] Shutting down plugin 'binlog'
2018-04-27T06:19:58.684862Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

2018-04-27T06:19:58.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/promote.cache-dns.local.pid ended
2018-04-27T06:20:17.6NZ mysqld_safe Logging to '/usr/local/mysql/data/promote.cache-dns.local.err'.
2018-04-27T06:20:17.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2018-04-27T06:20:17.858307Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-27T06:20:17.858623Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2018-04-27T06:20:17.858681Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.22) starting as process 74099 ...
2018-04-27T06:20:17.862304Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2018-04-27T06:20:17.864238Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
。。。
2018-04-27T06:20:17.974766Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180427 14:20:17
2018-04-27T06:20:17.979963Z 0 [Warning] World-writable config file './auto.cnf' is ignored.
2018-04-27T06:20:17.980313Z 0 [Warning] World-writable config file './auto.cnf' has been removed.

2018-04-27T06:20:17.980442Z 0 [Note] Salting uuid generator variables, current_pid: 74099, server_start_time: 1524810017, bytes_sent: 0,
2018-04-27T06:20:17.981447Z 0 [Note] Generated uuid: '0e38e800-49e3-11e8-923e-349449b2a00d', server_start_time: 2410270227098231444, bytes_sent: 140675991470080
2018-04-27T06:20:17.981508Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 0e38e800-49e3-11e8-923e-349449b2a00d.
2018-04-27T06:20:18.003889Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-04-27T06:20:18.005731Z 0 [Warning] CA certificate ca.pem is self signed.
2018-04-27T06:20:18.013245Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-04-27T06:20:18.013348Z 0 [Note] IPv6 is available.
2018-04-27T06:20:18.013382Z 0 [Note]   - '::' resolves to '::';
2018-04-27T06:20:18.013516Z 0 [Note] Server socket created on IP: '::'.
2018-04-27T06:20:18.013731Z 0 [ERROR] Could not remove unix socket lock file /tmp/mysql.sock.lock.
2018-04-27T06:20:18.013748Z 0 [ERROR] Unable to setup unix socket lock file.
2018-04-27T06:20:18.013759Z 0 [ERROR] Aborting

2018-04-27T06:20:18.013776Z 0 [Note] Binlog end
。。。
2018-04-27T06:20:19.355799Z 0 [Note] Shutting down plugin 'binlog'
2018-04-27T06:20:19.355972Z 0 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

2018-04-27T06:20:19.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/promote.cache-dns.local.pid ended
</code>

[ERROR] Could not remove unix socket lock file /tmp/mysql.sock.lock

<code>➜  AliyunRdsMysql ll /tmp/mysql.sock.lock
-rwxrwxrwx  1 _mysql  wheel     6B  4 26 14:15 /tmp/mysql.sock.lock
➜  AliyunRdsMysql sudo rm -rf /tmp/mysql.sock.lock
➜  AliyunRdsMysql rm /usr/local/mysql/data/promote.cache-dns.local.err
➜  AliyunRdsMysql /usr/local/mysql/support-files/mysql.server start
Starting MySQL
. SUCCESS!
</code>

【总结】

此处,感觉是:

此处的mysql的data目录,以及data下的mysql子目录,始终存在权限问题,然后最后实在不行,用了:

<code>sudo chmod -R 777 /usr/local/mysql/data
</code>

但是结果还是出错。

最后是彻底删除了数据目录:

<code>sudo rm -rf /usr/local/mysql/data
</code>

然后再去:

<code>mysql_install_db --user=mysql --datadir=/usr/local/mysql/data
</code>

就可以install成功了。

接着再去:

<code>/usr/local/mysql/support-files/mysql.server start
</code>

但是出错,但是好像就变成了sock的错误。

然后去删除掉sock:

<code>sudo rm -rf /tmp/mysql.sock.lock
</code>

最后终于:

<code>/usr/local/mysql/support-files/mysql.server start
</code>

成功了。

转载请注明:在路上 » 【已解决】Mac中启动mysql出错:ERROR The server quit without updating PID file

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.197 seconds, using 22.16MB memory