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

相关推荐
易点云徐源12 小时前
(已解决)adb devices 不显示设备,但 Windows 的 ADB Interface 正常:一次 WinUSB 与旧版 ADB 兼容性排查实战
windows·adb
夜雪一千1 天前
MySQL 全局锁是什么?原理、风险、备份踩坑完整实战
android·mysql·adb
clorinda1 天前
MySQL 入门笔记:DQL 基础查询与常用函数
adb
Code额1 天前
基于 SQLAlchemy 2.x,面向 MySQL 数据库的从入门到精通实战教程(2)
数据库·sql·mysql·adb·ai
游戏开发爱好者82 天前
WebSocket 抓包怎么查看内容?从握手到消息帧完整解读
网络协议·计算机网络·网络安全·ios·adb·https·udp
00后程序员张3 天前
SSL Pinning 抓包抓不到明文?绕过证书固定的几种方案
网络协议·计算机网络·网络安全·ios·adb·https·udp
没文化的阿浩4 天前
【MySQL】数据类型
android·mysql·adb
黄毛火烧雪下5 天前
智能眼镜无线adb调试
adb
游戏开发爱好者85 天前
带签名时间戳接口的重放与压力测试实战,用动态值在发送前现算签名
网络协议·计算机网络·网络安全·ios·adb·https·压力测试
Lethehong7 天前
MySQL迁移如何做到零改造?四层兼容方案详解
数据库·mysql·adb