This tutorial walks you through installing the popular Open Source database application, MySQL, on CentOS/Fedora/REL Linux systems by using the YUM Package Manager. The YUM Package Manager is an automatic installer/de-installer for Red Hat based systems. It will download requested applications from a network of repository servers where the latest stable versions of popular applications are stored. If you wish to install a newer version of an application than is available on the YUM repositories, you can always compile it from the source code.
For this article, we are making these assumptions:
In order to keep your server secure, update all of the software on your server with YUM using this command:
# sudo yum -y update
After the updates are finished, use the following command to install the MySQL server:
# sudo yum -y install mysql-server
After the installation is finished, you can start the database application for the first time. Upon initial startup, it creates several test databases and the MySQL system databases.
Use this command in order to start the server:
# sudo /etc/init.d/mysqld start
Now that you have the MySQL server running, you need to secure the installation.
# sudo /usr/bin/mysql_secure_installation
Your MySQL installation is now finished. Keep in mind that this only supports local connections and does not allow you to connect remotely. The article MySQL - Connect to your database remotely explains how to make a remote connection from another server to your database.
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License