今天上午升级了最新版本的Mac Pro 系统版本到14.0,升级结束后,启动原来安装的Mysql 8.0,一直启动不了。报错:
houxiurong@houxiurong ~$ mysql -uroot -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
通过Bing搜索,给了很多复杂的处理方式,都不行,最后发现是服务在升级MacOS的时候异常停止,重启后没有完全启动。
网友遇到的问题解决方案,尝试好几种方法都不行,最后看了MySQL PID,死活系统找不到,确定是服务没启动。
最后使用方法如下: 一定要 [ sudo 方式 ]
houxiurong@houxiurong ~$ sudo mysql.server start
Password:
Starting MySQL
.Logging to '/usr/local/mysql/data/houxiurong.local.err'.
. SUCCESS!
houxiurong@houxiurong ~$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.31 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
下面附上: [/usr/local/mysql/data/houxiurong.local.err] 文件内容
2023-09-28T08:57:26.595487Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.31) starting as process 24055
2023-09-28T08:57:26.605607Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2023-09-28T08:57:26.663315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-09-28T08:57:27.103268Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-09-28T08:57:27.495060Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-09-28T08:57:27.495105Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-09-28T08:57:27.517918Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2023-09-28T08:57:27.517987Z 0 [System] [MY-010931] [Server] /usr/local/mysql/bin/mysqld: ready for connections. Version: '8.0.31' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server - GPL.