[root@XXX ~]# mysql -h localhost -uroot -p
Enter password:
ERROR (HY000): Can't connect to local MySQL server through socket '/tmp/mysql/mysql.sock' (2) [root@XXX ~]# mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql/mysql.sock' (2)

换成

[root@XXX ~]# mysql -h 127.0.0.1 -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7.-log Source distribution Copyright (c) , , 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. mysql>

原因:MySQL设置成了值允许 127.0.0.1 地址访问

最新文章

  1. iOS项目常用效果方法注意点集锦
  2. 微软正式发布Visual Studio 2013 Update 3 (2013.3) RTM
  3. Security » Authorization » 基于声明的授权
  4. javascript学习第三课引用类型object
  5. 添加Bootstrap 到MVC项目中(vs2010)
  6. import了sun开头的类,虽然它在代码里压根就没派上用处!但是必须得引用!
  7. vijos 1053Easy sssp
  8. mybatis系列-02-mybatis框架
  9. hadoop 2.0 详细配置教程
  10. 学习C++ Primer 的个人理解(七)
  11. Eclipse导入git上的maven web项目 部署
  12. asp.net ajax检查用户名是否存在代码
  13. WPF报表自定义通用可筛选列头-WPF特工队内部资料
  14. 2018年1月 常用的linux命令
  15. .net 上传文件 Failed to load resource: net::ERR_CONNECTION_RESET Bug 解决
  16. 连接慢的主要原因是DNS解析导致
  17. JSP的三个脚本元素
  18. 前端笔记-javaScript-1
  19. LDOOP设置关联后超出新起一页LinkNewPage
  20. vue-cli@3.x初体验之前篇-回顾vue-cli@2.x创建项目的流程

热门文章

  1. 廖雪峰Java1-3流程控制-5循环
  2. python之路——4
  3. Android点赞音效播放
  4. window.open打开新窗口报错ie 位指明错误,原因是window没有加引号!
  5. remmina从linux远程桌面连接windows失败解决方法
  6. 基于Boost的同步TCP通信
  7. 用Python进行人脸识别
  8. APIO 2018选圆圈
  9. Django实现瀑布流,组合搜索
  10. WPF圆角按钮与触发颜色变化