事情是这样的, 在迁移 MacBook Pro 的配置后, 我们先执行 brew services start mysql@5.7
是没有异常的, 但是用 DataGrip 测试连接
出现
[08S01] Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Communications link failure
问题, 忘记截图了
之后意识到 brew services 其实启动没有成功
使用 brew list mysql@5.7
找到 mysql 的位置在命令行启动, 执行/usr/local/Cellar/mysql@5.7/5.7.35/bin/mysql
,
出现
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
错误,
之后执行 sudo /usr/local/Cellar/mysql@5.7/5.7.35/bin/mysql.server start
出现
Starting MySQL .Logging to '/usr/local/var/mysql/${yourMacBooksName}.local.err'. ERROR! The server quit without updating PID file (/usr/local/var/mysql/${yourMacBooksName}.local.pid).
看了很多博客, 试了不少方法, 有一个让完全卸载然后重装,
mac mysql报错:The server quit without updating PID file (/usr/local/var/mysql/mac_name.local
但是出现权限问题, 使用 sudo
都不行, 报
Error: Running Homebrew as root is extremely dangerous and no longer supported.
错误, 还执行了一堆命令
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 mysql.server start # no sudo!
没什么用, 还改了一堆 own
应该早看 StackOverflow 解决方案
最后执行这个 sudo chmod -R 777 /usr/local/var/mysql/
之后出现了
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) 可能禁用了以下必需的算法: SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, include jdk.disabled.namedCurves。编辑禁用算法的列表以纳入必需的算法。您可以先尝试启用 TLSv1 或 TLSv1.1。 JDBC 驱动程序可能已禁用 TLS 1.1 及其更早的版本。.
已经没有截图, 查了是 Java8 以后加密算法的问题, 在 DataGrip 中选择启用***协议(记不清了)
就行