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 小时前
MySQL——1、数据库基础
数据库·adb
2501_9111212312 小时前
MySQL高可用
adb
fengye20716117 小时前
在MYSQL中导入cookbook.sql文件
数据库·mysql·adb
ACGkaka_2 天前
MySQL 学习(十)执行一条查询语句的内部执行过程、MySQL分层
学习·mysql·adb
后端码匠2 天前
MySQL 8.0安装(压缩包方式)
android·mysql·adb
问道飞鱼2 天前
【数据库知识】Mysql进阶-高可用MHA(Master High Availability)方案
数据库·mysql·adb·高可用·mha
tiging2 天前
centos7.x下,使用宝塔进行主从复制的原理和实践
数据库·mysql·adb·主从复制
董可伦2 天前
Dinky 安装部署并配置提交 Flink Yarn 任务
android·adb·flink
VirusVIP3 天前
Windows CMD通过adb检查触摸屏Linux驱动是否被编译
linux·运维·adb
didiplus4 天前
MySQL 8.0 OCP(1Z0-908)英文题库(31-40)
mysql·adb·ocp·数据库管理员·mysql认证