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

Video: Using MySQL in cPanel

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

Remove STRICT_TRANS_TABLES in SQL Mode for WHMCS

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

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 config.inc.php for phpMyAdmin

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