如何修复MacOS上崩溃的MySQL实例?

时间:2019-05-13 17:14:24

标签: mysql macos sockets

昨晚MySQL出现问题。我先卸载了它,然后重新安装了它,现在按照此处的一些卸载说明,我无法连接服务器:

https://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x

^我认为上面的教程可能是导致我现在发生的许多套接字问题的原因

日志文件:

2019-05-13T17:35:42.702359Z 0 [System] [MY-010910] [Server] /usr/local/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.16)  MySQL Community Server - GPL.
2019-05-13T17:35:51.255099Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.16) starting as process 78228
2019-05-13T17:35:51.258608Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2019-05-13T17:35:51.635376Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-05-13T17:35:51.641789Z 0 [ERROR] [MY-010270] [Server] Can't start server : Bind on unix socket: Address already in use
2019-05-13T17:35:51.641800Z 0 [ERROR] [MY-010258] [Server] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?

netstat展望:

➜  invisible-hand git:(2.1.0) ✗ netstat -na | grep LISTEN
tcp4       0      0  127.0.0.1.53           *.*                    LISTEN     
tcp4       0      0  *.52772                *.*                    LISTEN     
tcp4       0      0  *.52607                *.*                    LISTEN     
tcp4       0      0  127.0.0.1.4244         *.*                    LISTEN     
tcp4       0      0  *.57621                *.*                    LISTEN     
tcp4       0      0  127.0.0.1.63777        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.62722        *.*                    LISTEN     
tcp6       0      0  *.61500                *.*                    LISTEN     
tcp4       0      0  *.61500                *.*                    LISTEN     
tcp4       0      0  127.0.0.1.1023         *.*                    LISTEN     
tcp4       0      0  127.0.0.1.29754        *.*                    LISTEN     
tcp4       0      0  127.0.0.1.29834        *.*                    LISTEN

在编辑my.cnf文件以更改正在使用的端口之后,它仍然具有以下输出:

$ mysql -uroot -p
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
$ mysql_secure_installation
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
/usr/local/etc/my.cnf
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1

[client]
port = 3306
socket = /tmp/mysql.sock

检查设置-> MySQL服务器重新打开和关闭。

MySQL设置/实例GUI: 在start实例之后,MySQL实例每次都会在2-4秒后关闭,尝试多次卸载和重新安装后问题仍然存在。

我尝试通过brew安装,但仍然没有运气。

这是我的流程的输出:

➜  invisible-hand git:(2.1.0) ✗ ps aux | grep mysql   
user         74665   0.0  0.0  4277256    808 s000  S+   10:13AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mysql

➜  invisible-hand git:(2.1.0) ✗ ps aux | grep mysqld
user         74676   0.0  0.0  4277256    808 s000  S+   10:13AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mysqld

如何解决套接字问题并使实例可靠地运行而不会不断崩溃?谢谢!

0 个答案:

没有答案