PHP学院的中学生 2021-09-03 22:26:34 1089次浏览 0条回复 0 0 0
一、查看默认端口号

1、登录mysql

[root ~]# mysql -uroot -p
Enter 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 ~]# vi /etc/my.cnf

2、添加port=2032;

3、重启mysql [root ~]# /etc/init.d/mysqld restart
    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册