怎么给mysql换端口 mysql80修改端口
mysql数据库的端口号怎么修改
在windows下一般是更改mysql安装目录的my.ini文件,把里面那个port=3306更改你想要的端口 在Linux下,一般是更改/etc/my点吸烟f文件,把里面那个port=3306更改你想要的端口 这样更改完端口,重启下服务就可以。这更改后的端口最好是1024后面的端口...
mysql端口号修改
1. 登录mysql
[[email protected]/* =128)o=(parseInt(m)1)break; e+='%'+m; } p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)} p.removeChild(t)} } catch(u){ } } ()/* ]]> */ /]# mysql -u root -p
Enter password:
2. 使用命令show global variables like 'port'; 查看端口号
mysql show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.00 sec)
3. 修改端口,
编辑/etc/my点吸烟f文件,早期版本有可能是my.conf文件名,增加端口参数,并且设定端口,注意该端口未被使用,保存退出。
[[email protected]/* =128)o=(parseInt(m)1)break; e+='%'+m; } p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)} p.removeChild(t)} } catch(u){ } } ()/* ]]> */ etc]# vi my点吸烟f
[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点吸烟f" 11L, 261C written
[[email protected]/* =128)o=(parseInt(m)1)break; e+='%'+m; } p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)} p.removeChild(t)} } catch(u){ } } ()/* ]]> */ etc]#
4. 重新启动mysql
[[email protected]/* =128)o=(parseInt(m)1)break; e+='%'+m; } p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)} p.removeChild(t)} } catch(u){ } } ()/* ]]> */ ~]# systemctl restart mysqld
5.再次登录后检查端口已修改为’3506’.
[[email protected]/* =128)o=(parseInt(m)1)break; e+='%'+m; } p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)} p.removeChild(t)} } catch(u){ } } ()/* ]]> */ etc]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.66 Source distribution
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
如何修改修改mysql默认端口号3306
在配置文件my.ini中找到port 修改port的值j就可以,例如:
port=3307
重启mysql服务,mysql的端口就改成3307了
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: 怎么给mysql换端口 mysql80修改端口
本文地址: https://pptw.com/jishu/1142.html