当前位置:网站首页>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 restartsee 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)
- 探讨:想要落地DevOps的话,只考虑好的PaaS容器平台就够了么?
- 工业通讯领域的总线、协议、规范、接口、数据采集与控制系统
- 微服务架构下的系统集成
- quii cordova-plugin-telerik-imagepicker插件多图上传乱序
- ABB electromagnetic flowmeter maintenance signal transmitter maintenance 41f/e4 technical parameters
- Bug of Dom4j
- 移动端空余部位自动填充
- How to select and build the container cloud platform that hosts the key applications of the bank?
猜你喜欢
随机推荐
Timing analysis and constraints based on Xilinx
证券企业基于容器化 PaaS 平台的 DevOps 规划建设 29 个典型问题总结
Study - Summary of geometric calculations
Ctfshow question making web module web11~web14
The 35 required questions in MySQL interview are illustrated, which is too easy to understand
Discussion: if you want to land Devops, is it enough to only consider a good PAAS container platform?
SSM-使用@Async和创建ThreadPoolTaskExecutor线程池
面向千元级5G手机市场,联发科天玑700发布
First week of internship diary
What functions does MySQL have? Don't look everywhere. Just look at this.
Explain C language 12 in detail (C language series)
MySQL sorts out the review content -- with mind map
国产芯片厂商助力,2020年白牌TWS耳机出货已达6亿部
百度搜索为什么只抓取,却不展现页面?
怎么理解数据网格(Data Mesh)
1162. 地图分析-非递归法
学习Typescript(二)
[input ID number] is replaced by an asterisk, and input is cut into multiple small squares (similar)
作价11.5亿元,1206件设备注入合资公司!SK海力士抢食大陆晶圆代工市场!
Kubeadm搭建kubernetes集群









