错误!服务器退出而不更新PID文件(/usr/local/var/mysql/`username`.lan.pid)

时间:2019-01-29 05:21:35

标签: mysql macos homebrew

我无法摆脱下面的错误。

  1. 通过/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"安装了自制软件
  2. brew install mysql

  3. mysql.server start给出错误:ERROR! The server quit without updating PID file (/usr/local/var/mysql/用户名.lan.pid).

我尝试过的一些事情:

ps -ef | grep mysql输出:

501 1196 1172 0 9:08PM ttys000 0:00.00 grep mysql

然后我尝试用kill -9 1172杀死它。这只是说Process Complete,但随后一个新进程开始运行。不知道这是否与它有关。

我曾经使用sudo chown -R mysql /usr/local/var/mysql/更改所有权,并尝试再次运气不佳。

我尝试从目录Macintosh HD⁩ ▸ ⁨usr⁩ ▸ ⁨local⁩ ▸ ⁨mysql-8.0.14-macos10.14-x86_64运行此程序,但没有运气。

我尝试删除错误日志并重新运行。

我刚刚将Mac更新为Mojave 10.14.3,不走运。

我尝试卸载并重新安装mysql。

我尝试通过下载链接而不是brew install

安装mysql

我尝试做unset TMPDIRmysql_install_db,但得到响应:-bash: mysql_install_db: command not found。我尝试从mysql-VERSION文件夹中运行此文件。

我不确定还有什么尝试。感谢帮助。

.err file

2019-01-24T19:46:47.6NZ mysqld_safe Logging to '/usr/local/var/mysql/ryans-macbook.lan.err'.
2019-01-24T19:46:47.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-24T19:46:47.525951Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 78796
2019-01-24T19:46:47.529750Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-24T19:46:47.535680Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:46:47.535720Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:46:47.535747Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2019-01-24T19:46:47.535869Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-01-24T19:46:47.535891Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-24T19:46:47.536598Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-24T19:46:47.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-24T19:47:05.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-24T19:47:05.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-24T19:47:05.861015Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 78949
2019-01-24T19:47:05.864718Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-24T19:47:05.871046Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:47:05.871084Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:47:05.871110Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2019-01-24T19:47:05.871264Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-01-24T19:47:05.871290Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-24T19:47:05.871961Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-24T19:47:05.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-24T19:51:27.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-24T19:51:27.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-24T19:51:27.979873Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 81867
2019-01-24T19:51:27.983686Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-24T19:51:27.998082Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:51:27.998131Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:51:27.998159Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2019-01-24T19:51:27.998299Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-01-24T19:51:27.998328Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-24T19:51:27.999095Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-24T19:51:28.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-24T19:52:04.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-24T19:52:04.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-24T19:52:04.660514Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 82584
2019-01-24T19:52:04.664208Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-24T19:52:04.670173Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:52:04.670215Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2019-01-24T19:52:04.670239Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2019-01-24T19:52:04.670387Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-01-24T19:52:04.670416Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-24T19:52:04.671195Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-24T19:52:04.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-24T19:53:38.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-24T19:53:38.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-24T19:53:38.430888Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 82806
2019-01-24T19:53:38.434733Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-24T19:53:38.905784Z 0 [Warning] [MY-000054] [Server] World-writable config file './auto.cnf' is ignored.
2019-01-24T19:53:38.905899Z 0 [Warning] [MY-010107] [Server] World-writable config file './auto.cnf' has been removed.
2019-01-24T19:53:38.905985Z 0 [Warning] [MY-010075] [Server] 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: be330a06-2011-11e9-8f30-eeb7cad0b310.
2019-01-24T19:53:38.921773Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-24T19:53:38.928389Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-01-24T19:53:38.928416Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-01-24T19:53:38.928458Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-24T19:53:40.656950Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-24T19:53:40.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-24T19:59:06.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-24T19:59:06.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-24T19:59:07.597870Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 679
2019-01-24T19:59:07.682119Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-24T19:59:08.398625Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-24T19:59:08.410090Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-01-24T19:59:08.410134Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-01-24T19:59:08.410179Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-24T19:59:09.753682Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-24T19:59:09.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-29T03:49:55.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-29T03:49:56.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-29T03:49:56.312175Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 17447
2019-01-29T03:49:56.315809Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-29T03:49:56.760978Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-29T03:49:56.768674Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-01-29T03:49:56.768706Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-01-29T03:49:56.768735Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-29T03:49:58.135724Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-29T03:49:58.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-29T04:35:11.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-29T04:35:11.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-29T04:35:11.604233Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 17821
2019-01-29T04:35:11.607955Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-29T04:35:11.904189Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-29T04:35:11.910582Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-01-29T04:35:11.910605Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-01-29T04:35:11.910638Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-29T04:35:13.403138Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-29T04:35:13.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-29T04:38:23.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-29T04:38:23.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-29T04:38:23.883516Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 17989
2019-01-29T04:38:23.887192Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2019-01-29T04:38:23.887568Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-29T04:38:23.887755Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-29T04:38:23.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-29T04:39:48.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-29T04:39:48.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-29T04:39:49.266658Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 18103
2019-01-29T04:39:49.270279Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-29T04:39:49.587646Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-29T04:39:49.593469Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-01-29T04:39:49.593491Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-01-29T04:39:49.593525Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-29T04:39:50.983373Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-29T04:39:51.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-29T05:04:29.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-29T05:04:29.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-29T05:04:30.224737Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 989
2019-01-29T05:04:30.245235Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-29T05:04:30.797676Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-29T05:04:30.805231Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-01-29T05:04:30.805265Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-01-29T05:04:30.805300Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-29T05:04:32.175755Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-29T05:04:32.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended
2019-01-29T05:39:19.6NZ mysqld_safe Logging to '/usr/local/var/mysql/-macbook.lan.err'.
2019-01-29T05:39:19.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2019-01-29T05:39:19.544597Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld (mysqld 8.0.13) starting as process 1882
2019-01-29T05:39:19.551070Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-01-29T05:39:19.984015Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-01-29T05:39:19.991348Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-01-29T05:39:19.991394Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-01-29T05:39:19.991430Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-01-29T05:39:21.359167Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.13/bin/mysqld: Shutdown complete (mysqld 8.0.13)  Homebrew.
2019-01-29T05:39:21.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/-macbook.lan.pid ended

2 个答案:

答案 0 :(得分:0)

基于日志,您的数据目录/usr/local/var/mysql/具有错误的权限。

Homebrew似乎使用current user of the brew ,并且该用户应该拥有数据目录和下面的所有内容。

mysql_install_db在MySQL-8.0中已删除。

答案 1 :(得分:0)

问题:

当我使用自制软件安装mysql时,我也遇到同样的问题。在这种情况下,它来自上一个mysql版本获得的/usr/local/var/mysql/权限。即使我们使用sudo mysql.server,它仍然是错误。

$ mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/[username].local.pid).

解决方案:

这是我的解决方案,我删除了mysql处的/usr/local/var/mysql/目录,然后再次开始使用homebrew重新安装。我为我解决了以下问题:

$ sudo rm -rf /usr/local/var/mysql
$ brew reinstall mysql

结果:

$ mysql.server start
Starting MySQL
. SUCCESS!