使用命令查看端口号:
show global variables like 'port';
mysql端口号的修改,编辑/etc/my.cnf文件
vim /etc/my.cnf
在 [mysqld] 中添加
port=3307
重启mysql ,若增加port=3307后无法启动MySQL,考虑SELinux问题。
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
不需要重启Linux,输入命令:
setenforce 0