How to install mySQL in centOS with SSH

If you’re new to server management and just bought an unmanaged VPS, then I am sure you don’t know what to do next. Because all you got from your provider is root ssh access credentials. I’ve had a lot of people asking me questions lately about managing a server and installing services on it. So I decided to write down a few articles explaining how to manage a dedicated server or a VPS.

In this article, I would be teaching you how to install mySQL on a centOS VPS with SSH.

Almost every un-managed VPS would be an empty box and wouldn’t have anything installed on it. Still you want to make sure that it already does not have any mySQL server installed on it. You can check existing mySQL info with following command:

which mysql

 

If you find out you already have an old version of mysql, use following commands to uninstall it.

yum remove mysql-server
yum remove sql

 

Now that you’ve cleaned up everything, its time for us to install latest version of mysql on your server.

yum install mysql mysql-server

Now, we want to add mysql to start up, so every time your server restarts, mySQL starts automatically.

chkconfig -levels 235 mysqld on
/etc/init.d/mysqld start

Now, you should be setting up the ROOT password for mysql, so that no one can access your databases without permission. Use following command:

mysqladmin -u root password yourNEWpassword
mysqladmin -h your.server.com -u root password yourNEWpassword

That is all you’ve got to do to set up mySQL server on your VPS. IF you didn’t get any error, means you’ve done it successfully. It is a pretty straight forward method to be honest.

Incoming search terms:

Leave a Reply

*
Premium Wordpress Themes