当使用mysql -uroot -p -h272.16.1.51 登录数据库的时候,用的是TCP协议,用status命令查看:
MysqL> status;
--------------
MysqL Ver 14.14 distrib 5.6.38, for Linux (x86_64) using EditLine wrapper
Connection id: 10
Current database:
Current user: root@MysqL03
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.38-log Source distribution
Protocol version: 10
Connection: 172.16.1.53 via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 18 min 40 sec
而不加 h 的时候,是这样的:
MysqL> status;
--------------
MysqL Ver 14.14 distrib 5.6.38, for Linux (x86_64) using EditLine wrapper
Connection id: 11
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.38-log Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /application/mysql-5.6.38/tmp/MysqL.sock
Uptime: 21 min 36 sec
是使用的UNIX socket,即UNIX套接字。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。