Mac 下mysql遇到的问题

2017-10-14  本文已影响0人  SoJax

1.mysql服务没有启动

打开myql时出现异常,由于mysql服务没有启动

mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

2.启动mysql报错

启动mysql和Windows及Ubuntu稍有不同,sodu service mysql start不存在

sodu service mysql start
sudo: service: command not found

查看下mysql的路径

where mysql
/usr/local/bin/mysql

进到相关目录下可以看到mysql.server

mysql.server start
Starting MySQL
. SUCCESS!

ok mysql启动成功

上一篇下一篇

猜你喜欢

热点阅读