Linux | Mysql 修改 port 后无法使用

使用命令查看端口号:

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

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43271844/article/details/119459808