事先说明我的mysql版本为5.7.9
修改mysql端口时报错“Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.”
先把my.cnf复原,退出
命令:
semanage port -a -t mysqld_port_t -p tcp 3307
再编辑my.cnf里的port,然后直接重启mysql即可,整个过程不需要停止mysql