Mysql socket连接测试

配置如下:

socket = /data/mysql/data/mysql.sock //套接字文件

在数据库没有任何连接的情况下,可以看到3306端口和socket端口都在监听

mysql@t3-dtpoc-dtpoc-web04 bin\]$ netstat -an \| grep -i 3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:\* LISTEN \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ netstat -an \|grep -i /tmp/mysql.sock unix 2 \[ ACC \] STREAM LISTENING 1958079570 /tmp/mysql.sock 窗口1: \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ ./mysql -protocol=socket -uroot -p 窗口2: \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ ./mysql -protocol=socket -uroot -p 可以看到多了两个socket连接,但是3306端口没有连接 \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ netstat -an \| grep -i 3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:\* LISTEN \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ netstat -an \|grep -i /tmp/mysql.sock unix 2 \[ ACC \] STREAM LISTENING 1958079570 /tmp/mysql.sock unix 3 \[ \] STREAM CONNECTED 1959434943 /tmp/mysql.sock unix 3 \[ \] STREAM CONNECTED 1959434940 /tmp/mysql.sock \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ 窗口3:指定IP连接 \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ ./mysql -u root -p -h 127.0.0.1 Enter password: Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 14 Server version: 5.7.26-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, 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. 可以看到3306端口已连接 \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ netstat -an \| grep -i 3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:\* LISTEN tcp 0 0 127.0.0.1:45010 127.0.0.1:3306 ESTABLISHED tcp 0 0 127.0.0.1:3306 127.0.0.1:45010 ESTABLISHED \[mysql@t3-dtpoc-dtpoc-web04 bin\]$ netstat -an \|grep -i /tmp/mysql.sock unix 2 \[ ACC \] STREAM LISTENING 1958079570 /tmp/mysql.sock unix 3 \[ \] STREAM CONNECTED 1959434943 /tmp/mysql.sock unix 3 \[ \] STREAM CONNECTED 1959434940 /tmp/mysql.sock

相关推荐
超级小忍42 分钟前
如何配置 MySQL 允许远程连接
数据库·mysql·adb
betazhou12 小时前
mariadb5.5.56在centos7.6环境安装
android·数据库·adb·mariadb·msyql
fengye2071612 天前
板凳-------Mysql cookbook学习 (十)
学习·mysql·adb
进击的CJR3 天前
MySQL 8.0 OCP 英文题库解析(十)
mysql·adb·开闭原则
VirusVIP3 天前
解决:如何在Windows adb使用dmesg | grep检查内核日志
linux·adb
睡觉待开机3 天前
4. 数据类型
android·adb
进击的CJR4 天前
MySQL 8.0 OCP 英文题库解析(十一)
mysql·adb·开闭原则
___波子 Pro Max.4 天前
ADB推送文件到指定路径解析
adb
湿物男5 天前
mysql核心知识点
数据库·mysql·adb
fengye2071616 天前
板凳-------Mysql cookbook学习 (九--2)
学习·mysql·adb