修改mysql端口

1.登录mysql,查看端口号:

show global variables like ‘port’;
默认端口号是3306;

 

2.修改端口号:

vi /etc/my.cnf

增加行:

[client]
port=3388
3.重启mysqld服务:
service mysqld restart