当前位置:首页 - MySql

centos 查看修改mysql端口号

作者:高景洋 日期:2023-05-01 14:58:00 浏览次数:506

如何修改mysql端口号?

按以下步骤操作,即可实现端口号修改

1、登陆mysql后,执行以下命令,即可查看当前端口号

show global variables like 'port';


2、执行 vi /etc/my.cnf 修改配置文件,增加port=13306参数


[mysqld]
port=3506

3、重启mysql

service mysqld restart

本文永久性链接:
<a href="http://r4.com.cn/art230.aspx">centos 查看修改mysql端口号</a>
当前header:Host: r4.com.cn X-Host1: r4.com.cn X-Host2: r4.com.cn X-Host3: 127.0.0.1:8080 X-Forwarded-For: 100.28.227.63 X-Real-Ip: 100.28.227.63 X-Domain: r4.com.cn X-Request: GET /art230.aspx HTTP/1.1 X-Request-Uri: /art230.aspx Connection: close User-Agent: CCBot/2.0 (https://commoncrawl.org/faq/) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 If-Modified-Since: Fri, 01 Mar 2024 15:14:44 GMT Accept-Encoding: br,gzip