Install MySQL on CentOS Server

This tutorial provides step-by-step instructions for installing MySQL on Centos servers. 

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:

# /sbin/service mysqld start

Secure the Installation

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 at Server Reboot

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

# chkconfig mysqld on

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

Was this answer helpful?

 Print this Article

Also Read

How to Backup MySQL Databases

This can be used to back up a database. 1. Export A MySQL Database This example shows you how to...

Manually Create for phpMyAdmin

This article discusses the manual creation of for phpMyAdmin installation.To...

Video: Using MySQL in cPanel

This video tutorial provides Step-by-Step instructions for using MySQL in cPanel Shared Hosting...


WHMCS requires a setting on the MySQL or MariaDB server for the SQL Mode. To verify this, log...

Locating php.ini file

A critical file you often need to manage is the php.ini file. It controls many import aspects of...