• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to install MySQL Server 5.6 on CentOS 7 / RHEL 7

July 31, 2014 by Sharad Chhetri 47 Comments

In this tutorial we will learn, how to install MySQL Server 5.6 on CentOS 7 / RHEL 7 . In our previous post, we have installed MySQL Server 5.6 on CentOS 6.x/RHEL 7.x.

In CentOS 7/ RHEL 7 , now MariaDB is introduced as a defualt database. Still many Organisations/Company would like to continue with MySQL. Whereas System Admin who earlier worked on MySQL can easily work on MariaDB. MariaDB is a community-developed fork of the MySQL relational database management system.

MariaDB’s lead developer is Michael “Monty” Widenius, the founder of MySQL and Monty Program AB. He had previously sold his company, MySQL AB, to Sun Microsystems for US$1 billion. MariaDB is named after Monty’s younger daughter, Maria. (Reference taken from Wikipedia)

Install MySQL Server 5.6 on CentOS 7 / RHEL 7

Follow the given below steps to install MySQL Server 5.6 .
You must be login with root user in system

Download the Yum Repo package of MySQL Server 5.6

Download the rpm package, which will create a yum repo file for MySQL Server installation.

yum install wget
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

Install mysql-community-release-el7-5.noarch.rpm package

Install this downloaded rpm package by using rpm command.

rpm -ivh mysql-community-release-el7-5.noarch.rpm

After the installation of this package. We will get two new yum repo related to MySQL

[root@localhost ~]# ls -1 /etc/yum.repos.d/mysql-community*
/etc/yum.repos.d/mysql-community.repo
/etc/yum.repos.d/mysql-community-source.repo
[root@localhost ~]#

Installing MySQL Server

By using yum command, now we will install MySQL Server 5.6 . All dependencies will be installed itself.

yum install mysql-server

How to start/stop/restart MySQL Server

Now MySQL Server is installed on your system.

To start MySQL Service
, run command

systemctl start mysqld

To stop MySQL Service, run command

systemctl stop mysqld

To restart MySQL Service, run command

systemctl restart mysqld

To get status of MySQL Service, run command

systemctl status mysqld

Reset MySQL root password

On fresh installation of MySQL Server. The MySQL root user password is blank.
For good security practice, we should reset the password MySQL root user.

On newly installed MySQL Server, we generally recommend to use the command script. You have to just follow the instructions.

mysql_secure_installation

In another method,you can log into MySQL server database and reset the password in secure way.

mysql -u root

You will see mysql prompt like this mysql> . Use the below given commands to reset root’s password.

mysql> use mysql;
mysql> update user set password=PASSWORD("GIVE-NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Find mysql commands history without mysql server login
  2. How to install mysql server in RedHat and CentOS
  3. Install MySQL Server 5.6 in CentOS 6.x and Red Hat 6.x Linux
  4. How to check default storage engine in MySQL server
  5. Set delay replication to MySQL slave server
  6. How to install mysql server 5.6 on Ubuntu 14.04 LTS ( Trusty Tahr )
  7. How to install MySQL Server 5.7 on Ubuntu 14.04 LTS
  8. Setup MySQL master slave replication in CentOS 6
  9. How to create multiple mysql instance in CentOS 6.4 and Red Hat 6.4
  10. Install MariaDB Server 10 on CentOS 7 and RHEL 7 by using yum

Filed Under: Linux, mysql Tagged With: mysql

Reader Interactions

Comments

  1. Selva says

    September 8, 2021 at 11:33 am

    Really. I say thanks for your comments.

    Reply
  2. ronny says

    January 10, 2021 at 9:23 am

    really help me, one time directly succeed

    Reply
  3. Ram says

    March 26, 2020 at 1:05 pm

    Worked on the 1st try! Thank you sir!

    Reply
    • Sharad Chhetri says

      May 9, 2020 at 3:00 am

      Perfect ! Thanks for commenting Ram ๐Ÿ™‚

      Regards
      Sharad

      Reply
  4. Odwa says

    April 16, 2019 at 7:32 am

    easy to to follow instructions, thanks, they helped me a lot

    Reply
  5. gerardo says

    May 24, 2018 at 9:44 pm

    thanks a lot, i now installed mysql 5.6.

    Reply
  6. ignorant says

    February 13, 2018 at 5:55 am

    Amazing work dear Sharad. I am so grateful for your perfect instructions that are fool proof. In fact I had to clean mariadb 5.5 from centos 7 and also a 56 version i had first. If anyone tries when earlier versions are there they may have errors like many comments here.
    Each previous install of mysql should be uninstalled and then reinstall. My suggestion is that you could add in your article if someone has another ver of mysql they may like to uninstall first after saving their current databases if any, I did on a new setup so it did work without any error. Thanks and appreciations for your good work. Thanks.

    Reply
  7. Jason says

    December 2, 2016 at 8:34 am

    Thank you very much, it helps me a lot.

    Reply
  8. John says

    March 25, 2016 at 1:48 pm

    This is a great tutorial. However, I have a server with Plesk 12.5 and Centos 7 that installed the default MariaDB. I need to use the native Mysql 5.6. So my question is how do I replace mariadb with mysql 5.6 or if I follow the steps above, how does plesk see the mysql database server as localhost/default.

    I do not want to do a complete reinstall of Plesk and the server.

    Thanks

    John

    Reply
« Older Comments

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

WordPress host IP changed not able to open wp-admin and site page looks scattered

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

30 useful Linux terminal keyboard shortcuts

Yum Error database disk image is malformed

How to put slider shortcode only in home page in WordPress

How to use grep command to get fixed pattern or exact keyword

Nagios HTTP WARNING: HTTP/1.1 403 Forbidden

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy