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
标题URL:https://www.cdcxhl.com/article38/gphgsp.html

成都网站建设公司_创新互联,为您提供软件开发App开发企业建站品牌网站设计网站排名静态网站

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

网站托管运营