CentOS Linux 5/6 Install Mysql Database Server

To install MySQL server on CentOS 5/6, follow these steps:

  1. Add the MySQL repository:
wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm
sudo yum localinstall mysql57-community-release-el6-9.noarch.rpm
  1. Install the MySQL server:
sudo yum install mysql-server
  1. Start the MySQL service:
sudo service mysqld start
  1. Set the root password:
mysqladmin -u root password 'new_password'

Replace new_password with the desired password for the MySQL root user.

  1. Enable automatic startup on boot:
sudo chkconfig mysqld on

The MySQL server should now be installed and running on your CentOS system. You can connect to the server and start using it by running the following command:

mysql -u root -p

You will be prompted for the root password you set in step 4.

Leave a Comment