python mysql创建数据遇到的问题集合

2017-09-22  本文已影响0人  HopCoder

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.````
上一篇下一篇

猜你喜欢

热点阅读