mysql socket 与IP区别_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)
##正確方法,指定通信協議 --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>
標簽:bin,protocol,socket,##,IP,MySQL,mysql,Oracle
來源: https://blog.51cto.com/accole/2468277
總結
以上是生活随笔為你收集整理的mysql socket 与IP区别_MySQL本地用IP登陆而非socket的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 为什么代码正确却没有爬虫的信息_为什么敷
- 下一篇: 全国战争linux添加eth0,linu