HOW TO: Installing MySQL on RedHat/CentOS/Amazon Linux in 5 easy steps.

This seems like it should be a really complicated tasks, but once you have done a few it sinks in that this is really simple…


Just run each of the following 5 steps as root.  Answer any questions with the common sense response, and you are done

yum groupinstall “MySQL Database”
/usr/bin/mysql_install_db –user=mysql
service mysqld start
chkconfig mysqld on


Step 1 uses the groupinstall  command to install all of the most common mysql daemons.  This one line eliminates perhaps half a dozen steps.

Step 2 does the initial DB configuration for the software.  You can select the defaults for all most all options, but when it asks about security, say no because we are gonna do it in the next two lines.

Step 3 starts the MySQL server for the first time

Step 4 when run with all the defaults secures your server nicely.

Step 5 is one that lots of  the tutorials miss.  When you reboot your DB server, it would be nice if MySQL ran right? Well this line does that.


If you want to change your server configuration from the default, run this line:

nano /etc/my.cnf

After saving, if you are done restart the MySQL daemon:

service mysqld start

Simple as that, you are done… Any Questions?

Add a Comment

Your email address will not be published. Required fields are marked *