mysql 8.0.12 修改默认端口的坑

示例:修改默认端口3306为3308
1.编辑配置文件my.cnf

vim /etc/my.cnf

2.加入内容port=3308


1.png

3.重启mysqld

systemctl restart mysqld
结果发现启动失败
2.png
查看日志内容mysqld.log
vim /var/log/mysqld.log
发现以下内容
2018-10-17T15:44:56.581810Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Permission denied
2018-10-17T15:44:56.581831Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3308 ?
2018-10-17T15:44:56.581877Z 0 [ERROR] [MY-010119] [Server] Aborting
简单粗暴的解决办法:关掉selinux,重启mysqld就可以了
/usr/sbin/setenforce 0
systemctl restart mysqld

你可能感兴趣的:(mysql 8.0.12 修改默认端口的坑)