Step-by-Step Guide to Installing MariaDB on CentOS 6.5
- Update system packages:
sudo yum update
- Install EPEL repository (optional):
sudo yum install epel-release
- Install MariaDB server package:
sudo yum install mariadb-server mariadb-client
- Start MariaDB service:
sudo systemctl start mariadb
- Secure MariaDB installation (This is interactive and won't show the commands):
sudo mysql_secure_installation
Note: When running mysql_secure_installation
, it will prompt you to set a root password, remove anonymous users, disallow root login remotely, and reload privilege tables. Respond accordingly to secure your installation.
- Connect to MariaDB (after setting a password):
mysql -u root -p
(Enter your root password when prompted)
- Compiling from Source:
This method gives you more control over the installation process, allowing you to customize build options. However, it's also the most complex and time-consuming approach. You'll need to download the MariaDB source code, configure build options, compile the software, and then manually install it. Refer to the MariaDB documentation for detailed instructions:
- Using Yum Repositories with Pre-built Binaries:
While the official MariaDB yum repositories might not be available for CentOS 6.5 by default due to its age, there are third-party repositories that offer pre-built MariaDB binaries. Use caution with these repositories as they might not be officially supported by MariaDB and could introduce security risks.
Here's a general outline (Remember to replace <repo_url>
with the actual repository URL):
Add the repository using
yum
:sudo yum install -y yum-utils sudo yum-config-manager --add-repo `<repo_url>`
Import the GPG key (if provided by the repository)
sudo rpm --import <GPG_KEY_URL> # Replace with the actual GPG key URL
Update package information and install MariaDB:
sudo yum update sudo yum install mariadb-server mariadb-client
Important points to consider with third-party repositories:
- Security: Research the reputation of the repository before adding it.
- Compatibility: Ensure the provided MariaDB version is compatible with CentOS 6.5.
- Support: You might not receive official support for issues encountered using these repositories.
mariadb