【问题标题】:MySQL abort right after startingMySQL在启动后立即中止
【发布时间】:2020-09-06 23:52:30
【问题描述】:

就像标题中描述的那样,mysql在启动后就停止了,我搜索了很多主题,提出的每个解决方案都不适合我......

我正在使用最新的 os x,通过 DMG 全新安装 mysql 8.0。

我的 my_pc.err 文件在 mysql/data 文件夹中表明:

2020-05-20T14:43:07.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2020-05-20T14:43:07.693358Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.20) starting as process 25586
2020-05-20T14:43:07.697083Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2020-05-20T14:43:07.697155Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2020-05-20T14:43:07.697233Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-05-20T14:43:07.697410Z 0 [System] [MY-010910] [Server] /usr/local/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.20)  MySQL Community Server - GPL.
2020-05-20T14:43:07.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/MacBook-Pro-de-CanardWc.local.pid ended
2020-05-20T14:43:17.6NZ mysqld_safe Logging to '/usr/local/mysql/data/MacBook-Pro-de-CanardWc.local.err'.
2020-05-20T14:43:17.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 

我尝试使用 mysql 已经有几年了,但从未设法让它工作。我试过了:

sudo /usr/local/mysql/support-files/mysql.server start,它给了我这个: Starting MySQL . ERROR! The server quit without updating PID file (/usr/local/mysql/data/MacBook-Pro-de-CanardWc.local.pid).

我在我的 mysql 文件夹上使用了 chmod。

我在 bash_profile 上更改了路径,但仍然找不到 mysql 和 mysqld 命令。

我也试过这个: /usr/local/mysql/bin/mysqladmin --port=8889 -u root shutdown 它会这样回应:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)'
Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists! 

ps -ef | grep mysqld 给了我这个信息:

501 22093   549   0  6:52PM ttys004    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox mysqld
/usr/local/mysql/bin/mysql -h 127.0.0.1 -P 3306 -u root -p

给这个:

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61)

我的 /var/mysql/mysql.sock 是空的

sudo pkill mysqld

不会杀死进程

使用https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks 重新安装,但是当我执行 mysql_secure_installation 时出现此错误:

Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

【问题讨论】:

  • 错误列在那里:Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 当你尝试stackoverflow.com/questions/25700971/… 时会发生什么?当您说“提出的每个解决方案都对我不起作用”时,您还遇到了哪些其他问题?请编辑您的问题以包括您尝试过的其他内容以及结果。您是否也尝试过mariadb.com/kb/en/running-mysqld-as-root 的建议?
  • 你的两个链接都没有解决问题:/
  • 编辑您的问题,包括您尝试过的解决方案以及这些解决方案的结果。为了进一步的帮助,需要比“它不起作用”更具描述性的东西。 SO只能根据您提供的信息来帮助您,到目前为止Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!基本上是我们可以尝试调试的所有内容,它在网络上有各种工作解决方案。
  • 我 15 分钟前做的,我认为这是我的 .sock 文件和/或我的 PID 不存在的问题

标签: mysql macos


【解决方案1】:

经过几次搜索,我发现我只需要卸载它并使用 brew 重新安装它。很遗憾 dmg 不起作用,但现在我可以正常使用 mysql。

非常感谢您花时间帮助我

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-22
    • 1970-01-01
    • 1970-01-01
    • 2013-07-19
    • 1970-01-01
    相关资源
    最近更新 更多