如何查看mysql运行在哪个端口号,有两种方法,如下:
1. 可以到配置文件my.cnf(Linux)或my.ini(Windows)中查看
[mysqld]
port = 3306
2.在命令行查看
mysql> show variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.02 sec)