Saturday, 15 September 2018

How to Install MySQL Server 5.7 on CentOS 6



MySQL Community Server is an open source free database management system. It uses a relational database and SQL (Structured Query Language) to manage its data.
Step 1: Install MySQL Repository: Download the yum repository rpm from MySQL official site on Server: http://dev.mysql.com/downloads/repo/yum/

[root@linuxcnf ~]# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
……………………
100%[=======================================>] 8,848       --.-K/s   in 0.001s

2018-09-13 21:20:05 (10.3 MB/s) - “mysql57-community-release-el6-7.noarch.rpm.1” saved [8848/8848]

[root@linuxcnf ~]#

Step 2: After downloading the package, run the following command to install the downloaded rpm package:

[root@linuxcnf ~]# yum localinstall mysql57-community-release-el6-7.noarch.rpm
………………….
Installed:
  mysql57-community-release.noarch 0:el6-7

Complete!
[root@linuxcnf ~]#

[root@linuxcnf ~]# yum repolist | grep -i MySQL
Mysql-connectors-community MySQL Connectors Community                    59
Mysql-tools-community      MySQL Tools Community                              65
mysql57-community          MySQL 5.7 Community Server                        273
[root@linuxcnf ~]#

Step 3: MySQL yum repository enabled on Server. Now run the following command to install MySQL 5.7 community server:

[root@linuxcnf ~]# yum install mysql-community-server
………………………
Installed:
mysql-community-client.x86_64 0:5.7.23-1.el6        
mysql-community-common.x86_64 0:5.7.23-1.el6   
mysql-community-libs.x86_64 0:5.7.23-1.el6
mysql-community-libs-compat.x86_64 0:5.7.23-1.el6   
mysql-community-server.x86_64 0:5.7.23-1.el6   

Complete!
[root@linuxcnf ~]#

Step 4: Run the following commands to Start MySQL 5.7 Server and configure for auto start at OS boot up:

[root@linuxcnf ~]# service mysqld start
Starting mysqld:                                           [  OK  ]
[root@linuxcnf ~]# service mysqld status
mysqld (pid  27892) is running...
[root@linuxcnf ~]#
[root@linuxcnf ~]# chkconfig mysqld on
[root@linuxcnf ~]#
[root@linuxcnf ~]# chkconfig --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@linuxcnf ~]#

Step 5: Now run the following command to verify the installed MySQL version:

[root@linuxcnf ~]# mysql -V
mysql  Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using  EditLine wrapper
[root@linuxcnf ~]#

It’s done, MySQL 5.7 Server Installed successfully!!!

No comments:

Post a Comment