007-Centos 7.x 安装 Mysql 5.7.13
1. 下载mysql的repo源
CentOS 7.2的yum源中默认没有mysql,要先下载mysql的repo源
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
2. 安装mysql57-community-release-el7-8.noarch.rpm包
rpm -ivh mysql57-community-release-el7-.noarch.rpm --nodeps --force
3.安装mysql
yum install mysql-server
4. 启动mysql服务
查看MySQL服务是否已启动
service mysqld status
启动服务
systemctl start mysqld
对应的stop、restart等
5. 重置root密码
MySQL5.7会在安装后为root用户生成一个随机密码,而不是像以往版本的空密码。
可以安全模式修改root登录密码或者用随机密码登录修改密码。下面用随机密码方式
MySQL为root用户生成的随机密码通过mysqld.log文件可以查找到:
grep 'temporary password' /var/log/mysqld.log
修改root用户密码:(MySQL的密码策略比较复杂,过于简单的密码会被拒绝)
mysql -u root -p
mysql> Enter password: (输入刚才查询到的随机密码)
mysql> SET PASSWORD FOR 'root'@'localhost'= "Root-123";
mysql> exit
用root新密码登录:
mysql -u root -pRoot-
住:如果上面的方式不能修改可以使用下面安全模式修改root:
关闭服务
systemctl stop mysqld.service
vi /etc/my.cnf
mysqld下面添加skip-grant-tables 保存退出启动服务
systemctl start mysqld.service
mysql -u root 不用密码直接回车
use mysql
update user set authentication_string=password('Root-123') where User='root' and Host='localhost';
flush privileges;
exit;
vi /etc/my.cnf 把 skip-grant-tables 一句删除保存退出重启mysql服务
systemctl restart mysqld.service
再次登录即可
mysql -u root -pRoot- 如果进行操作出现下面的提示:
You must reset your password using ALTER USER statement before executing this statement.
就再设置一遍密码
set password = password('Root-123');
6. 开放3306端口
允许使用用户名root密码Root-123456从任何主机连接到mysql服务器
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Root-123456' WITH GRANT OPTION;
mysql>FLUSH PRIVILEGES;
mysql>exit;
开启防火墙mysql 3306端口的外部访问
firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --reload
原文地址:http://blog.csdn.net/lochy/article/details/51721319
007-Centos 7.x 安装 Mysql 5.7.13的更多相关文章
- 在CentOS上编译安装MySQL 5.7.13步骤详解
MySQL 5.7主要特性 更好的性能 对于多核CPU.固态硬盘.锁有着更好的优化,每秒100W QPS已不再是MySQL的追求,下个版本能否上200W QPS才是用户更关心的. 更好的InnoDB存 ...
- centos上如何安装mysql
centos可以使用yum安装mysql 但是版本很低,且不灵活. 本文将介绍如何使用安装包安装mysql http://dev.mysql.com/downloads/mysql/ 下载mysql ...
- CentOS 7离线安装MySQL 5.7
系列文章首发平台为果冻想个人博客.果冻想,是一个原创技术文章分享网站.在这里果冻会分享他的技术心得,技术得失,技术人生.我在果冻想等待你,也希望你能和我分享你的技术得与失,期待. 前言 网上已经有那么 ...
- centos 7 中安装 mysql 5.7
centos 7 中安装 mysql 5.7 环境说明: 查看centos的版本:cat /etc/redhat-release 安装和配置步骤: 下载 mysql 源安装包: sudo curl - ...
- CentOS 6.5 安装MySQL数据库
CentOS 6.5 安装MySQL数据库 [root@seeker~]# yum -y install mysql-server //安装命令 [root@seeker~]# service mys ...
- CentOS 7.0yum安装MySQL
CentOS 7.0yum安装MySQL 1.下载mysql的repo源 $ wget http://repo.mysql.com/mysql-community-release-el7-5.noar ...
- CentOS 6.9安装MySQL 5.6 (使用yum安装)
CentOS 6.9安装MySQL 5.6 (使用yum安装) 移除CentOS默认的mysql-libs [root@test01 srv]# whereis mysqlmysql: /usr/li ...
- CentOS 7 下安装 MySQL 5.7
从 CentOS 7 系统开始,MariaDB 成为 yum 源中默认的数据库安装包.在 CentOS 7 及以上的系统中使用 yum 安装 MySQL 包将无法使用 MySQL.您可以选择使用完全兼 ...
- 20190526 - CentOS 7 中 安装 MySQL 8 并授权 root 远程访问
1. CentOS 7 中 安装 MySQL 8 CentOS 7 中内置 MariaDB 建议升级一下用,性能好很多.但如果一定要用 MySQL 8,就得自己装. 坦白的说,Oracle 升级 My ...
- centos 6.10 安装mysql 5.7.27 出现缺少libnuma.so.1的问题
centos 6.10安装mysql 5.7.27出现以下报错: [root@localhost /]# /usr/local/mysql/app/mysql/bin/mysqld --default ...
随机推荐
- 0044 spring框架的applicationContext.xml的命名空间
Spring框架中,创建bean,装配bean,事务控制等,可以用xml配置或者注解扫描的方法实现.如果用注解扫描,在xml配置中得加上 <context:component-scan base ...
- linux内核开机logo显示调试
要使内核支持开机logo显示需要配置内核 配置如下: make menuconfig: Device Drivers ---> Graphics support ---> ...
- 在Linux系统上查看Apache服务器的错误日志
错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为 Web 服务器排障,保护系统不受各种各样的恶意活动侵犯,或者只是进行各种各样的分析以监控 HTTP 服务器.根据你 Web 服务器配置的不 ...
- 用Vue.js递归组件构建一个可折叠的树形菜单
在Vue.js中一个递归组件调用的是其本身,如: Vue.component('recursive-component', { template: `<!--Invoking myself! ...
- Windows 动态库创建和使用 part 2
一.Windows动态库的创建: 1.先选择 "DLL" 和 “控项目” 2.添加一个头文件,一个源文件 CppDll.h,CppDll.cpp,一个模块定义文件 CppDll. ...
- CI框架整合微信公共平台接口
#CI框架控制器 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /*** CI框架整合微信 ...
- Windows下RabbitMQ安装,部署,配置
安装部署 1.当前环境以及参考资料出处 部署环境:windows server 2008 r2 enterprise 官方安装部署文档:http://www.rabbitmq.com/install- ...
- lstrcpyn
看代码时遇到的一些不会用的函数,记录下来. 1. lstrcpyn LPTSTR lstrcpyn( __out LPTSTR lpString1, __in LPCTSTR lpString2, _ ...
- Android版微信小代码(转)
以下代码仅适用于Android版微信: //switchtabpos:让微信tab更贴合Android Design 如果你并不喜欢微信Android版和iOS端同用一套UI,现在有一个小方法可以实现 ...
- Android 扁平化button
View 创建 colors.xml 文件定义两个颜色 1. <resources> 2. <color name="blue_pressed">@ ...