MySQL在启动后立即中止

时间:2020-05-20 14:47:22

标签: mysql macos

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

我通过DMG通过最新安装的mysql 8.0更新了OS X。

mysql / data文件夹中的

my my_pc.err 文件指示以下内容:

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)

1 个答案:

答案 0 :(得分:0)

经过几次搜索,我发现我只需要卸载它并用brew重新安装它。很难过,dmg无法正常工作,但现在我可以正确使用mysql了。

非常感谢您花时间帮助我<3

相关问题