mac brew 安装 mysql8 无法启动

2023-02-15 16:01:32 +08:00
 silverdog
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook-Pro-3.local.pid).



xxxxx@MacBook-Pro-3 ~ % brew services info mysql
mysql (homebrew.mxcl.mysql)
Running: ✔
Loaded: ✔
Schedulable: ✘
User: root
PID: 598
xxxxx@MacBook-Pro-3 ~ % mysql
mysql: [Warning] World-writable config file '/etc/my.cnf' is ignored.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Users/xxxxx/Documents/mysql.sock' (2)
xxxxx@MacBook-Pro-3 ~ % mysql -u root
mysql: [Warning] World-writable config file '/etc/my.cnf' is ignored.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Users/chengpeng/Documents/mysql.sock' (2)
chengpeng@MacBook-Pro-3 ~ %


macos 13
试了办法
brew remove mysql
brew cleanup
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /usr/local/var/mysql

brew install mysql
mysqld --initialize --explicit_defaults_for_timestamp
mysql.server start # no sudo!
1865 次点击
所在节点    程序员
22 条回复
silverdog
2023-02-16 14:30:07 +08:00
@julyclyde 有时能起来但是停止不了,brew 显示停止后还能链接 mysql,目前不知道怎么回事
julyclyde
2023-02-16 16:41:41 +08:00
@intkilow 那说明你连接到那个不是从 brew 启动的而是从别处启动的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/916371

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX