MySQL本地用IP登陆而非socket

##想当然的指定hostname和端口。。。。失败
[root@MySQL01 ~]# /opt/mysql/bin/mysql -uroot -h localhost -P 3307 -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

10年积累的成都网站设计、网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有永宁免费网站建设让你可以放心的选择与我们合作。

##正确方法,指定通信协议 --protocol tcp
[root@mysql01 ~]# /opt/mysql/bin/mysql -uroot -h localhost -P 3307 -p --protocol tcp
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.6.31-log Source distribution

Copyright (c) 2000, 2016, 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本地用IP登陆而非socket
文章起源:http://bzwzjz.com/article/gphgsp.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站设计 成都网站制作 成都网站设计公司 营销型网站建设 网站设计 高端网站设计 成都网站制作 企业网站建设 成都网站设计公司 成都企业网站制作 成都网站设计 专业网站设计 成都商城网站制作 品牌网站建设 企业网站建设公司 高端网站设计 网站制作 外贸网站建设 成都网站设计 成都网站建设 网站建设方案 定制网站制作