当前位置:网站首页>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
边栏推荐
- Yyds dry inventory interview must brush top101: every k nodes in the linked list are turned over
- Space shooting Lesson 13: explosion effect
- Explain in detail the rays and radiographic testing in unity
- Unity typewriter teaches you three ways
- 全链路灰度在数据库上我们是怎么做的?
- What is data center? What value does the data center bring_ Light spot technology
- 既要便捷、安全+智能,也要颜值,萤石发布北斗星人脸锁DL30F和极光人脸视频锁Y3000FV
- Unity performance optimization
- JS fly into JS special effect pop-up login box
- How can enterprises successfully complete cloud migration?
猜你喜欢

Random talk on GIS data (VI) - projection coordinate system

How to use redis to realize things and locks?

Introduction to redis II: RedHat 6.5 installation and use

Why on earth is it not recommended to use select *?

既要便捷、安全+智能,也要颜值,萤石发布北斗星人脸锁DL30F和极光人脸视频锁Y3000FV

How to balance security and performance in SQL?
![[C language brush questions] explanation of linked list application](/img/44/1de4e3f0712780680fbdc904dfe39a.png)
[C language brush questions] explanation of linked list application

Thinking and summary of R & D Efficiency

到底为什么不建议使用SELECT * ?

Confusing knowledge points of software designer examination
随机推荐
Yyds dry inventory interview must brush top101: every k nodes in the linked list are turned over
Unity uses shader to quickly make a circular mask
3D激光SLAM:LeGO-LOAM论文解读---简介部分
Redis 3.0源码分析-数据结构与对象 SDS LIST DICT
Report redirect after authorized login on wechat official account_ The problem of wrong URI parameters
卡通js射击小游戏源码
Nat experiment demonstration (Huawei switch equipment configuration)
JS drag and drop alert pop-up plug-in
flask 静态文件服务搭建
Unity makes prefabricated bodies with one key and modifies prefabricated bodies with one key
一个程序员的水平能差到什么程度?尼玛,都是人才呀...
Laser slam:logo-loam --- code compilation, installation and gazebo test
PostgreSQL数据库删库前是不是需要把所有连接断开才能删除?
Algorithm interview high frequency problem solving guide [1]
Oracle库访问很慢,是什么原因?
Use order by to sort
How to use redis to realize things and locks?
leetcode:2141. 同时运行 N 台电脑的最长时间【最值考虑二分】
到底为什么不建议使用SELECT * ?
云原生编程挑战赛火热开赛,51 万奖金等你来挑战!