cent7.0 mysql 修改端口
- 如何查看mysql 默认端口号和修改端口号 2015-03-19 17:42:18
- 1. 登录mysql
- [root@test /]# 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.cnf文件,早期版本有可能是my.conf文件名,增加端口参数,并且设定端口,注意该端口未被使用,保存退出。
- [root@test etc]# vi 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
- [root@test etc]#
- 4. 重新启动mysql
- [root@test ~]# /etc/init.d/mysqld restart
- Stopping mysqld: [ OK ]
- Starting mysqld: [ OK ]
- 5.再次登录后检查端口已修改为’3506’.
- [root@test 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.
- 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.
- mysql> show global variables like 'port';
- +---------------+-------+
- | Variable_name | Value |
- +---------------+-------+
- | port | 3506 |
- +---------------+-------+
- 1 row in set (0.00 sec)
- mysql>
- 总结:注意修改的端口不要被占用,而且要有规划,不要轻意的总是调整数据库端口。还有就是安全保障,记得与负责网络的人提前通知,以免端口无法正常使用。
cent7.0 mysql 修改端口的更多相关文章
- mysql修改端口经验
mysql更改端口修改/etc/my.cnf添加port=3308修改后如下[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sock ...
- windows 8.0 mysql 修改root 密码
Mysql 忘记root密码和修改root密码的解决方法(小结) 一.以下是Windows操作系统的操作步骤: 1. 关闭正在运行的MySQL服务-->net stop mysql 2. 打开D ...
- MySQL修改端口号操作
在C盘下的program Files下找到MySQL文件夹 - my.ini配置文件有个port=3306 修改即可
- vue-cli3.0怎么修改端口?
在根目录新建 vue.config.js 文件 module.exports = { devServer: { port: 8888, // 端口 }, lintOnSave: false // 取消 ...
- 有关WAMPSERVER 环境搭建 如何修改端口,MySQL数据库的修改
环境搭建 http://share.weiyun.com/88896747fedd4e8b19afebea18f7684c 一.修改Apache的监听端口 1.在界面中选Apache,弹出隐藏菜单选项 ...
- 查看mysql 默认端口号和修改端口号
1. 登录mysql mysql -u root -p //输入密码 2. 使用命令show global variables like 'port';查看端口号 mysql> show glo ...
- Windows10系统下查看mysql的端口号并修改
mysql的端口号默认是3306,初学者可能有时会忘记或者之前修改了默认的端口号,忘记了,或者很多时候我们一台电脑需要安装两个mysql或者想设置一个自己的喜欢的数字,那么接下来我们来看看如何查看或者 ...
- linux的mysql修改默认端口3306
linux 修改mysql默认端口3306 cd /etc/mysql/my.cnf 修改两处 客户端的port=3306 和mysqld的服务器端口port=3306 [client] port=3 ...
- IntelliJ IDEA 2017版 spring-boot修改端口号配置把端口号改为8081
1.修改端口号主要是通过配置文件修改.如图: 完整版配置 ######################################################## ###server 配置信息 ...
随机推荐
- python---基础知识回顾(六)网络编程2(处理粘包)
前戏: 之前在python---基础知识回顾(六)网络编程异步模块中提到过粘包现象,而且在使用twisted中提到过一种处理办法,按行接收lineReceived,当收到\r\n换行符时,才去缓冲区中 ...
- HDU 1525 类Bash博弈
给两数a,b,大的数b = b - a*k,a*k为不大于b的数,重复过程,直到一个数为0时,此时当前操作人胜. 可以发现如果每次b=b%a,那么GCD的步数决定了先手后手谁胜,而每次GCD的一步过程 ...
- 经典全屏滚动插件fullPage.js
要写简单可以写的很简单,对着github上面的参数和注释随便写了个demo.这个插件十分高端大气上档次,配上良好的配色和布局,简单几笔就可以把网站装扮得十分洋气. 唯一的缺点就是,感觉对移动端的兼容性 ...
- 鸟哥的书——ubuntu命令
纯粹按着鸟哥的书上的基本命令打一遍,不喜勿喷! Chapter5.首次登录 一.基础命令: 1.显示时间和日期的命令:date dzhwen@deng:~$ date 2014年 02月 23日 星期 ...
- [php]mysqli操作流程
<?php class SqlTools{ private $con; private $trans; public function __construct($host, $user, $ps ...
- 51nod1312 最大异或和
题目来源: TopCoder 基准时间限制:1 秒 空间限制:131072 KB 分值: 320 有一个正整数数组S,S中有N个元素,这些元素分别是S[0],S[1],S[2]...,S[N-1]. ...
- std::max 错误
Today I typed the following: int t = (std::max)(timeout, lagtime); Why did I put parentheses around ...
- mogodb的安装与配置
下载:https://www.mongodb.com/https://www.mongodb.com/ 安装:一直next,中间选择custom,选择自己的安装路径,最后安装成功. 配置:打开安装好的 ...
- 怎么样通过编写Python小程序来统计测试脚本的关键字
怎么样通过编写Python小程序来统计测试脚本的关键字 通常自动化测试项目到了一定的程序,编写的测试代码自然就会很多,如果很早已经编写的测试脚本现在某些基础函数.业务函数需要修改,那么势必要找出那些引 ...
- Spring4笔记1--Spring概述、IoC
Spring概述: Spring框架: Spring 由 20 多个模块组成,它们可以分为数据访问/集成(Data Access/Integration).Web.面向切面编程(AOP, Aspec ...