linux服务器mysql MariaDB端口修改加固安全防范

- 1600850315 4297f44b1395523

先来查看端口

root@:~# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 383
Server version: 5.5.68-MariaDB Source distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> show global variables like ‘port’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| port | 3306 |
+—————+——-+
1 row in set (0.01 sec)

MariaDB [(none)]>

下面进入vi修改端口,改红字修改的两个地方端口再 :wq保存即可

root@:~# vi /etc/my.cnf
[client]
#password = your_password
port = 3001
socket = /tmp/mysql.sock

[mysqld]
port = 3001

重启一下MariaDB服务

systemctl restart mariadb.service

 

再查看端口,就显示了我们修改的端口了

root@:~# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.68-MariaDB Source distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> show global variables like ‘port’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| port | 3001 |
+—————+——-+
1 row in set (0.00 sec)

MariaDB [(none)]>

上一篇 腾讯云socks5配置方法-新手入门级方案(附配套软件)
下一篇 cubecloud:十月特惠月付/季付/半年付/年付循环全场9折优惠码

投稿邮箱:
[email protected] (投稿详情)

TG订阅频道:
t.me/ivpsr_news 网站最新内容推送

TG交流群:
(点击加入) 用户交流

文章列表
1
Mondoze马来西亚住宅VPS测评,无限流量、适配东南亚多账号矩阵
Mondoze马来西亚住宅VPS测评,无限流量、适配东南亚多账号矩阵
2
新手入门Debian 10系统简单安装 IonCube Loader
新手入门Debian 10系统简单安装 IonCube Loader
3
Digital-VM:6折循环优惠码至2021年底,VPS低至$2.4/月,10Gbps口大带宽,不限流量,8个机房:日本\新加坡\美国\英国\西班牙\荷兰\挪威\丹麦
Digital-VM:6折循环优惠码至2021年底,VPS低至$2.4/月,10Gbps口大带宽,不限流量,8个机房:日本\新加坡\美国\英国\西班牙\荷兰\挪威\丹麦
4
justhost洛杉矶QLA2 VPS 6折循环优惠,不限流量可一键切换机房&IP
justhost洛杉矶QLA2 VPS 6折循环优惠,不限流量可一键切换机房&IP
5
Linveo美国VPS测评,AMD Ryzen9 9950X俄亥俄州哥伦布机房、大流量超大10Gbps带宽、解锁Netflix、TikTok、ChatGPT
Linveo美国VPS测评,AMD Ryzen9 9950X俄亥俄州哥伦布机房、大流量超大10Gbps带宽、解锁Netflix、TikTok、ChatGPT
6
windows10、7系列的v2rayN新版的安装和使用详细篇
windows10、7系列的v2rayN新版的安装和使用详细篇
7
flipperhost便宜美国VPS低至$29.99/年,2核2G内存、35gSSD、5T流量1Gbps带宽、洛杉矶、纽约机房
flipperhost便宜美国VPS低至$29.99/年,2核2G内存、35gSSD、5T流量1Gbps带宽、洛杉矶、纽约机房
8
.VMDK文件使用方法VMWARE虚拟机科普教学
.VMDK文件使用方法VMWARE虚拟机科普教学
9
Navicosoft:美国VPS,5折促销仅4.5美元/月,1核/512M内存/10G硬盘/500G流量/1Gbps
Navicosoft:美国VPS,5折促销仅4.5美元/月,1核/512M内存/10G硬盘/500G流量/1Gbps
10
巴基斯坦计划于2024年推出5G
巴基斯坦计划于2024年推出5G