码迷,mamicode.com
首页 > 数据库 > 详细

Red Hat 7.2 RPM安装Mysql 5.7.11

时间:2016-03-16 01:36:35      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:red hat 7.2 rpm安装mysql 5.7.11

查看是否安装了mysql
rpm -qa | grep mysql

卸载mysql
rpm -e –nodeps

解压mysql
tar -xvf mysql-5.7.11-1.el7.x86_64.rpm-bundle.tar

安装mysql
yum install mysql-community-{client,common,libs}-*  

rpm -ivh mysql-community-server-5.7.11-1.el7.x86_64.rpm

启动Mysql服务
systemctl start mysqld.service

生成随机密码
grep ‘temporary password‘ /var/log/mysqld.log
2016-03-15T11:25:13.632616Z 1 [Note] A temporary password is generated for root@localhost: X9.L=p4iylZD

查看MySQL服务器的状态
sudo service mysqld status
配置随机密码
mysql -uroot -p
X9.L=p4iylZD
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘HanZheng.123‘;

重新登陆
mysql -uroot -p
HanZheng.123

本文出自 “为梦想奋斗” 博客,谢绝转载!

Red Hat 7.2 RPM安装Mysql 5.7.11

标签:red hat 7.2 rpm安装mysql 5.7.11

原文地址:http://hanzheng.blog.51cto.com/3080616/1751471

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!