Install MySQL on CentOS 7 Server

This tutorial provides step-by-step instructions for installing MySQL database server on CentOS 7.

Install MySQL

Login to the server as root user

To install the database software, run the following command:

$ yum install mysql-server

Start MySQL Server

To start the MySQL server, run the following command:

$ systemctl start mysqld

Secure the MySQL

To secure the MySQL installation, you should remove the anonymous user created during installation. To do so, run the following command:

$ /usr/bin/mysql_secure_installation

Ensure MySQL Starts on Boot

To ensure that your MySQL database automatically starts when the server is rebooted, run the following command:

$ systemctl enable mysqld

Now you have successfully installed MySQL, started the MySQL server, removed anonymous user, and set the MySQL server to start automatically at reboot.

  • mysql, centos 7
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Create Sudo User on CentOS

This article provides step-by-step setup guide for adding Sudo user to CentOS system. The sudo...

How to Use Sudo

This article provides a guide to using a Sudo user on CentOS server. From the command line,...

Set Server Time Zones with Timedatectl

This article provides a guide to setting the server time and server time zone settings using...

htaccess RewriteRule Examples

Here are some useful mod_rewrite RewriteRule redirect examples that you can use in your .htaccess...

Using htaccess File to Block IPs

If your webserver is Apache, you may block access to your website from specific IP addresses...