Database

Step-by-Step MySQL 5.6 Server Installation On Centos 6.x And Redhat 6.x

mysql-5.6-installation
mm
Written by Santosh Prasad

Hello Friends, In this article I am going to explain how we can install MySQL 5.6 server in Centos 6.X and Redhat 6.x using yum command.

System

Server : CentOS release 6.7 (Final)

Architecture : i686 i386 GNU/Linux

Follow the below steps to install MySQL 5.6 server using yum command.

Installation

Login into server using ssh protocol. Download and install mysql-community repo using below command.

#ssh –I [email protected]_ip_and _hostname

#mkdir /root/dowload/

#cd /root/download/

Download and Install wget

#yum install wget

You will get back some output like below if you have already installed wget package.

Loaded plugins: fastestmirror
Setting up Install Process
\Loading mirror speeds from cached hostfile
* base: mirror.nbrc.ac.in
* epel: ftp.riken.jp
* extras: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
Package wget-1.12-8.el6.i686 already installed and latest version
Nothing to do

Now download and install mysql-community repo

#wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

--2016-11-25 06:30:03-- http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
Resolving repo.mysql.com... 104.108.196.141
Connecting to repo.mysql.com|104.108.196.141|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 5824 (5.7K) [application/x-redhat-package-manager]

Saving to: `mysql-community-release-el6-5.noarch.rpm' 100%[============================================================================================>] 5,824 --.-K/s in 0s

2016-11-25 06:30:04 (53.7 MB/s) - `mysql-community-release-el6-5.noarch.rpm' saved [5824/5824]

Install downloaded package

#rpm -ivh mysql-community-release-el6-5.noarch.rpm
Preparing... ########################################### [100%]
1:mysql-community-release############################################################################################################### [100%]

Install mysql 5.6 server using yum command

#yum install mysql-server

Loaded plugins: fastestmirror

Setting up Install Process

Loading mirror speeds from cached hostfile

* base: mirror.nbrc.ac.in

* epel: epel.mirror.net.in

* extras: mirror.nbrc.ac.in

* remi: mirrors.thzhost.com

* remi-php56: mirrors.thzhost.com

* remi-safe: mirrors.thzhost.com

* updates: mirror.nbrc.ac.in

ajenti | 2.5 kB 00:00

vz-base | 951 B 00:00

vz-updates | 951 B 00:00

Package mysql-server is obsoleted by mysql-community-server, trying to install mysql-community-server-5.6.34-2.el6.i686 instead

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-server.i686 0:5.6.34-2.el6 will be installed

--> Processing Dependency: mysql-community-common(x86-32) = 5.6.34-2.el6 for package: mysql-community-server-5.6.34-2.el6.i686

--> Processing Dependency: mysql-community-client(x86-32) >= 5.6.10 for package: mysql-community-server-5.6.34-2.el6.i686

--> Processing Dependency: libnuma.so.1(libnuma_1.2) for package: mysql-community-server-5.6.34-2.el6.i686

--> Processing Dependency: libnuma.so.1(libnuma_1.1) for package: mysql-community-server-5.6.34-2.el6.i686

--> Processing Dependency: libnuma.so.1 for package: mysql-community-server-5.6.34-2.el6.i686

--> Running transaction check

---> Package mysql-community-client.i686 0:5.6.34-2.el6 will be installed

--> Processing Dependency: mysql-community-libs(x86-32) >= 5.6.10 for package: mysql-community-client-5.6.34-2.el6.i686

---> Package mysql-community-common.i686 0:5.6.34-2.el6 will be installed

---> Package numactl.i686 0:2.0.9-2.el6 will be installed

--> Running transaction check

---> Package mysql-community-libs.i686 0:5.6.34-2.el6 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================

Package Arch Version Repository Size

======================================================================================================================================

Installing:

mysql-community-server i686 5.6.34-2.el6 mysql56-community 53 M

Installing for dependencies:

mysql-community-client i686 5.6.34-2.el6 mysql56-community 18 M

mysql-community-common i686 5.6.34-2.el6 mysql56-community 308 k

mysql-community-libs i686 5.6.34-2.el6 mysql56-community 1.8 M

numactl i686 2.0.9-2.el6 base 69 k

Transaction Summary

======================================================================================================================================

Install 5 Package(s)

Total size: 73 M

Installed size: 299 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

Installing : mysql-community-common-5.6.34-2.el6.i686 1/5

Installing : mysql-community-libs-5.6.34-2.el6.i686 2/5

Installing : mysql-community-client-5.6.34-2.el6.i686 3/5

Installing : numactl-2.0.9-2.el6.i686 4/5

Installing : mysql-community-server-5.6.34-2.el6.i686 5/5

Verifying : mysql-community-common-5.6.34-2.el6.i686 1/5

Verifying : mysql-community-client-5.6.34-2.el6.i686 2/5

Verifying : numactl-2.0.9-2.el6.i686 3/5

Verifying : mysql-community-libs-5.6.34-2.el6.i686 4/5

Verifying : mysql-community-server-5.6.34-2.el6.i686 5/5

Installed:

mysql-community-server.i686 0:5.6.34-2.el6

Dependency Installed:

mysql-community-client.i686 0:5.6.34-2.el6 mysql-community-common.i686 0:5.6.34-2.el6 mysql-community-libs.i686 0:5.6.34-2.el6

numactl.i686 0:2.0.9-2.el6

Complete!

After installation completed restart mysql service using below command.

#service mysqld start

Or

#/etc/init.d/ mysqld start

Note : We have installed MySQL server with blank root password. We will need to reset root password using “mysql_secure_installation” follow below instructions.

mysql_secure_installation

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current

password for the root user. If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none): <ENTER>

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n] <Type here “Y”>

New password:*****

Re-enter new password:*****

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them. This is intended only for testing, and to make the installation

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] <Type here “Y”>

... Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] < Type “ Y “ if you want to disable root remote loging for security purpose>

... Success!

By default, MySQL comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] < Type “Y” >

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n]

... skipping.

All done! If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

Cleaning up...

Now login with you root password

#mysql -uroot -p

Enter password:*****

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 14

Server version: 5.6.34 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

I hope this article will be helpful to you to install MySQL 5.6 server on Centos and Redhat. If you have any queries and problem please comment in comment section.

Thanks:)

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment