当前位置:网站首页>MySQL修改端口号(修改mysql的端口号会有问题吗)
MySQL修改端口号(修改mysql的端口号会有问题吗)
2022-07-28 18:53:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
关于mysql的端口号
先登录mysql:
[email protected]:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.26-0ubuntu0.18.04.1 (Ubuntu)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.输入命令:
show global variables like 'port';mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.04 sec)value的值即是自己的端口号;这里是3306,即默认端口号。
修改默认的端口号:
打开文件my.cnf,然后增加端口参数,设定端口,注意该端口应是未被使用的,注意一定要先保存再退出
[email protected]:~$ vim my.cnf
[mysqld]
port=3506
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
"my.cnf" 11L, 261C written
[email protected]:~$重启mysql:
[email protected]:~$ service mysqld restart查看mysql基本信息:
输入命令:
status;mysql> status;
--------------
mysql Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using EditLine wrapper
Connection id: 4
Current database:
Current user: [email protected]
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.7.26-0ubuntu0.18.04.1 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 3 hours 10 min 3 sec
Threads: 1 Questions: 9 Slow queries: 0 Opens: 105 Flush tables: 1 Open tables: 98 Queries per second avg: 0.000
--------------发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128806.html原文链接:https://javaforall.cn
边栏推荐
- Prometheus complete process of configuring alertmanager
- Explain the life cycle function in unity in detail
- System. ArgumentException: Object of type ‘System. Int64‘ cannot be converted to type ‘System.Int32‘
- Read the recent trends of okaleido tiger and tap the value and potential behind it
- Redis 3.0 source code analysis - data structure and object SDS list Dict
- 7/27 training log (bit operation + suffix array)
- Cartoon JS shooting game source code
- Establishment of flask static file service
- Space game Lesson 12: shield
- 【服务器数据恢复】HP StorageWorks系列存储RAID5两块盘故障离线的数据恢复案例
猜你喜欢

js飞入js特效弹窗登录框

Integrating database Ecology: using eventbridge to build CDC applications

h5微信射击小游戏源码

UE4 3dui widget translucent rendering blur and ghosting problems

Confusing knowledge points of software designer examination

想画一张版权属于你的图吗?AI作画,你也可以

Redis 3.0 source code analysis - data structure and object SDS list Dict

The 678th operation

Laser slam:logo-loam --- code compilation, installation and gazebo test

prometheus配置alertmanager完整过程
随机推荐
Space shooting lesson 14: player life
作业 ce
leetcode:2141. 同时运行 N 台电脑的最长时间【最值考虑二分】
Network layer performance test
卡通js射击小游戏源码
Space game Lesson 12: shield
Explain the script data transmission and notification in unity
Unity object path query tool
Unity package exe to read and write excel table files
Beautiful blue background form input box style
Learn about the native application management platform of rainbow cloud
js win7透明桌面切换背景开始菜单js特效
The cloud native programming challenge is hot, with 510000 bonus waiting for you to challenge!
如何平衡SQL中的安全与性能?
Prometheus complete process of configuring alertmanager
Fragment中使用ViewPager滑动浏览页面
Explain various coordinate systems in unity in detail
Space shooting Lesson 16: props (Part 2)
如何用Redis实现事物以及锁?
十七年运维老兵万字长文讲透优维低代码~