MySQL is one of the most popular open-source relational database management systems (RDBMS) in the world. It’s widely used for web applications, content management systems, and many other applications that require fast and reliable data storage. In this tutorial, we will show you how to install MySQL on Scientific Linux.
Table of Contents
- Step 1: Update Your System
- Step 2: Install MySQL
- Step 3: Start and Enable MySQL Service
- Step 4: Secure MySQL Installation
- Step 5: Test MySQL Installation
- A system running Scientific Linux
- A user account with sudo privileges
How to Install MySQL on Scientific Linux
Update Your System
First, update your system to ensure you have the latest packages and security patches. Open a terminal and enter the following command:
sudo yum update -y
Install MySQL on Scientific Linux
MySQL is available in the default repositories of Scientific Linux. To install it, run the following command:
sudo yum install -y mysql-server
The installation process may take a few minutes to complete, depending on your internet connection speed.
Start and Enable MySQL Service on Scientific Linux
Once the installation is complete, start the MySQL service and enable it to start at boot time:
sudo systemctl start mysqld sudo systemctl enable mysqld
Secure MySQL Installation on Scientific Linux
Securing your MySQL installation is crucial to protect your data and prevent unauthorized access. Run the following command to launch the MySQL security script:
The script will prompt you to set a root password and answer a series of questions related to security settings:
- Change the root password: Press ‘Y’ and enter a strong password for the root user.
- Remove anonymous users: Press ‘Y’ to remove anonymous users.
- Disallow root login remotely: Press ‘Y’ to prevent root login from remote machines.
- Remove test database and access to it: Press ‘Y’ to remove the test database.
- Reload privilege tables now: Press ‘Y’ to reload the privilege tables and apply the changes.
Test MySQL Installation on Scientific Linux
Now that MySQL is installed and secured, let’s test the installation. Log in to MySQL as the root user with the following command:
mysql -u root -p
Enter the root password you set during the secure installation process. If you see the MySQL command prompt, your installation is successful. You can now create databases, users, and manage your data.
Congratulations! You have successfully installed MySQL on Scientific Linux. Now you can proceed with setting up your web server, like installing Nginx or Apache, and configuring your application to use the MySQL database.