Linux Yum Install MySQL 5.6/5.7

安装MySQL的yum源,下面是RHEL6系列的下载地址

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

安装yum-config-manager

yum install yum-utils -y

禁用MySQL5.6的源

yum-config-manager –disable mysql56-community

启用MySQL5.7的源

yum-config-manager –enable mysql57-community-dmr

用下面的命令查看是否配置正确

yum repolist enabled | grep mysql

Install MySQL 5.7

yum install mysql-community-server

####Start MySQL Service

禁用selinux

setenforce 0
sed -i ‘/^SELINUX=/c\SELINUX=disabled’ /etc/selinux/config

启动mysqld,启动之前先修改/etc/my.cnf配置文件,本文用默认的配置。

service mysqld start

5.7的话需要连接数据库并修改root密码

cat /root/.mysql_secert;

Login MySQL & Set Password

SET PASSWORD = PASSWORD(‘xxxxxxxxxxxxx’);

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s