当前位置:网站首页>Modify the port number of MySQL (is there a problem modifying the port number of MySQL)
Modify the port number of MySQL (is there a problem modifying the port number of MySQL)
2022-07-28 21:29:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
About mysql Port number
Log on first 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.
Enter the command :
show global variables like 'port';
mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.04 sec)
value The value of is your own port number ; Here is 3306, Default port number .
Change the default port number :
Open file my.cnf, Then add port parameters , Set port , Note that the port should be unused , Be sure to save before exiting
[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]:~$
restart mysql:
[email protected]:~$ service mysqld restart
see mysql essential information :
Enter the command :
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
--------------
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/128806.html Link to the original text :https://javaforall.cn
边栏推荐
- Ctfshow network lost track record (1)
- 1162. Map analysis - non recursive method
- ctfshow 网络迷踪做题记录(2)
- 实现瀑布流效果
- What functions does MySQL have? Don't look everywhere. Just look at this.
- 高举5G和AI两面旗帜:紫光展锐市场峰会火爆申城
- 顶级“Redis 笔记”, 缓存雪崩 + 击穿 + 穿透 + 集群 + 分布式锁,NB 了
- Library borrowing system "suggested collection"
- Kubeadm搭建kubernetes集群
- 属性基加密仿真及代码实现(CP-ABE)论文:Ciphertext-Policy Attribute-Based Encryption
猜你喜欢
Timing analysis and constraints based on Xilinx
[tidb] importing TXT documents into the database is really efficient
Ctfshow network lost track record (1)
工业通讯领域的总线、协议、规范、接口、数据采集与控制系统
Two excellent software of my love cracking, batch search text, image and video image quality enhancement
ctfshow 网络迷踪做题记录(1)
属性基加密仿真及代码实现(CP-ABE)论文:Ciphertext-Policy Attribute-Based Encryption
Achieve waterfall effect
Uncaught Error:Invalid geoJson format Cannot read property ‘length‘ of undefind
Nacos 原理
随机推荐
SkiaSharp 之 WPF 自绘 拖曳小球(案例版)
How does lazada store make up orders efficiently? (detailed technical explanation of evaluation self-supporting number)
[Zhou Zhou has a prize] cloud native programming challenge "edge container" track invites you to fight!
Ijcai2022 tutorial | dialogue recommendation system
Maxwell 一款简单易上手的实时抓取Mysql数据的软件
Niuke turns on the camera and the picture disappears a few seconds later | the picture flashes when the camera is turned on
面向千元级5G手机市场,联发科天玑700发布
将字符串指针赋值给数组[通俗易懂]
First week of internship diary
Guanghetong & Qualcomm Internet of things technology open day successfully held
Library borrowing system "suggested collection"
分页功能(板子)
Coding with these 16 naming rules can save you more than half of your comments!
MySQL
八、QOS队列调度与报文丢弃
The 35 required questions in MySQL interview are illustrated, which is too easy to understand
SQL Server 数据库之备份和恢复数据库
九鑫智能正式加入openGauss社区
DELTA热金属检测器维修V5G-JC-R1激光测量传感器/检测仪原理分析
Several skills of API interface optimization