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

linux(centos6.8 64位)下安装mysql5.7(yum方式)

时间:2017-09-29 16:45:15      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:tor   col   temp   sql   修改   epo   特殊   必须   root密码   

下载mysql源安装包
# wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
 
安装mysql源包
#yum localinstall mysql57-community-release-el7-8.noarch.rpm

检查mysql源是否安装成功
# yum repolist enabled | grep "mysql.*-community.*"

看到下图(三个)表示成功:
mysql-connectors-community      MySQL Connectors Community      36
mysql-tools-community           MySQL Tools Community           47
mysql57-community               MySQL5.7 Community Server      189
 
安装MySQL服务
# yum install mysql-community-server

启动MySQL服务
# systemctl start mysqld
 
查看MySQL的启动状态
# systemctl status mysqld

设置开机启动
# systemctl enable mysqld
# systemctl daemon-reload #重新载入
 
查看root默认密码
# grep temporary password /var/log/mysqld.log

修改root密码
# mysql -uroot -p

mysql> ALTER USER root@localhost IDENTIFIED BY Abc1234!;
或者
mysql> set password forroot@localhost=password(Abc1234!);

注意:mysql5.7默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR 1819 (HY000): Your passworddoes not satisfy the current policy requirements错误

添加远程连接登录用户,如:用户名:test,密码:Abc@1234
mysql>GRANT ALL PRIVILEGES ON *.* TO test@%IDENTIFIED BY Abc@1234 WITH GRANT OPTION;

重启mysql服务
# systemctl restart mysqld

完毕,可远程用Navicat连接了。

 

linux(centos6.8 64位)下安装mysql5.7(yum方式)

标签:tor   col   temp   sql   修改   epo   特殊   必须   root密码   

原文地址:http://www.cnblogs.com/linjiqin/p/7611204.html

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