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

Posted Ruthless

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux(centos6.8 64位)下安装mysql5.7(yum方式)相关的知识,希望对你有一定的参考价值。

下载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 [email protected] WITH GRANT OPTION;

重启mysql服务
# systemctl restart mysqld

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

 

以上是关于linux(centos6.8 64位)下安装mysql5.7(yum方式)的主要内容,如果未能解决你的问题,请参考以下文章

centos6.8下安装dc2012

CentOS6.8下安装Docker

CentOS6.8下mysql5.6rpm手动安装

Linux centos6.8与7.2在虚拟机上安装后配置成实验环境命令及变化对比

1. linux centos6.8环境下安装jdk1.8

Linux Centos6.8 安装配置MongoDB-3.4.0