执行以下命令,用户是superset,可以看出连接方式是通过Unix socket(Localhost via UNIX socket),Unix socket文件是/tmp/mysql.sock。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$ mysqladmin -hlocalhost -usuperset -p version Enter password: mysqladmin Ver 8.0.34 for Linux on x86_64 (MySQL Community Server - GPL) Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Server version 8.0.34 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /tmp/mysql.sock Uptime: 31 min 49 sec
Threads: 2 Questions: 3537 Slow queries: 0 Opens: 191 Flush tables: 3 Open tables: 110 Queries per second avg: 1.852
执行以下命令,用户同样是superset,可以看出连接方式是TCP/IP(127.0.0.1 via TCP/IP),端口是3306。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$ mysqladmin -h127.0.0.1 -usuperset -p version Enter password: mysqladmin Ver 8.0.34 for Linux on x86_64 (MySQL Community Server - GPL) Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Server version 8.0.34 Protocol version 10 Connection 127.0.0.1 via TCP/IP TCP port 3306 Uptime: 38 min 34 sec
Threads: 2 Questions: 4252 Slow queries: 0 Opens: 191 Flush tables: 3 Open tables: 110 Queries per second avg: 1.837