当前位置:网站首页>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
边栏推荐
- [server data recovery] HP StorageWorks series storage RAID5 two disk failure offline data recovery case
- Seventeen year operation and maintenance veterans, ten thousand words long, speak through the code of excellent maintenance and low cost~
- Huawei cloud digital asset chain, "chain" connects the digital economy, infinite splendor
- 瀚高数据库最佳实践配置工具HG_BP日志采集内容
- How can enterprises successfully complete cloud migration?
- EasyNLP中文文图生成模型带你秒变艺术家
- 一个程序员的水平能差到什么程度?尼玛,都是人才呀...
- Laser slam:logo-loam --- code compilation, installation and gazebo test
- Space shooting lesson 14: player life
- LVS+KeepAlived高可用部署实战应用
猜你喜欢

How bad can a programmer be? Nima, they are all talents

The cloud native programming challenge is hot, with 510000 bonus waiting for you to challenge!

Unity gets which button (toggle) is selected under togglegroup

Explain prefabrication in unity in detail

LVS+KeepAlived高可用部署实战应用
![Leetcode:2141. The longest time to run n computers at the same time [the maximum value is two points]](/img/33/05620dfff2f6ac67691d20c5256c5b.png)
Leetcode:2141. The longest time to run n computers at the same time [the maximum value is two points]

Prometheus complete process of configuring alertmanager

Subcontracting loading of wechat applet

Space shooting Lesson 10: score (painting and writing)

Talking about canvas and three rendering modes in unity
随机推荐
Algorithm interview high frequency problem solving guide [1]
Redis 3.0源码分析-数据结构与对象 SDS LIST DICT
Lvs+keepalived high availability deployment practical application
js可拖拽alert弹窗插件
Cartoon JS shooting game source code
C foundation 2-encapsulation, inheritance, polymorphism
Interpretation of ue4.25 slate source code
【1331. 数组序号转换】
网络各层性能测试
Integrating database Ecology: using eventbridge to build CDC applications
JS chart scatter example
Unity package exe to read and write excel table files
How to balance security and performance in SQL?
Prize essay solicitation | 2022 cloud native programming challenge draft activity opens
Unity makes prefabricated bodies with one key and modifies prefabricated bodies with one key
C # basic 3-value type and reference type, packing and unpacking
Explain the imported 3D model in unity
Two written interview questions about regular
Explain rigid body and collider components in unity
Unity object path query tool