How to install mysql 5.6 or mysql 5.7 in RHEL/CENTOS

1.create a repo file using vim  /etc/yum.repos.d/mysql.repo command and add below lines for mysql 5.7 add

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

for mysql 5.6 add

[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

if you dont want gpg key checking change gpgcheck=0 and remove
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

if you want gpg checking then download  RPM-GPG-KEY-mysql file  using below command

cd /etc/pki/
wget https://repo.mysql.com/RPM-GPG-KEY-mysql

2. now type below command to install mysql server and mysql client.

yum install mysql-server mysql -y

once installation is finished type

mysql -V

to check mysql version.

Advertisements
This entry was posted in Mysql. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s