1、终端登陆mysql Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
执行命令 mysql -u root -p
如果设置了密码就输密码,没有设置就直接enter
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
说明你的mysql server没有启动
DsHdeMacBook-Pro:~ dsh$ mysql.server start
Starting MySQL
. SUCCESS!
重新执行 mysql -u root -p
DsHdeMacBook-Pro:~ dsh$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
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.````