您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Linux下如何查看MySQL端口

2024/7/3 14:11:01发布27次查看
mysql的端口默认为3306,但是在安装过程中有可能修改了mysql端口。
1、登录mysql
[root@localhost ~]# mysql -uroot -penter password: 输入数据库密码;
2、使用show global variables like ‘port’; 命令查看端口号,
mysql> show global variables like ‘port’;+—————+——-+| variable_name | value |+—————+——-+| port          | 3306  |+—————+——-+1 row in set (0.00 sec)
mysql>
3306即为端口号。
二、mysql端口号的修改
1、编辑/etc/my.cnf文件  [root@localhost ~]# vi /etc/my.cnf
2、添加port=2032;
3、重启mysql [root@localhost ~]# /etc/init.d/mysqld restart
以上就是linux下如何查看mysql端口的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product