Loading...

How to Install MySQL on CentOS 8

Simple.Predictable.Scalable

Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing MySQL on CentOS 8

MySQL is a popular open-source relational database management system (RDBMS) widely used for building web applications. It provides a reliable, scalable, and secure database platform for storing and managing structured data.

Step 1: Update the System

It's always recommended to start by updating your CentOS system to ensure you have the latest packages installed. Open a terminal and run the following command:


sudo dnf update -y

Step 2: Install MySQL

MySQL is available in the default CentOS repositories. Install it by running the following command:


sudo dnf install mysql-server -y

During the installation, you will be prompted to confirm the installation. Press 'y' and then press Enter to proceed.

Step 3: Start MySQL Service

After the installation is complete, start the MySQL service using the following command:


sudo systemctl start mysqld

Step 4: Configure MySQL

To ensure the security of your MySQL installation, run the following command to secure the installation:


sudo mysql_secure_installation

This command will guide you through a series of prompts to configure various security options for your MySQL installation. For example, you will be prompted to set a root password, remove anonymous users, disable remote root login, and remove test databases. Follow the prompts and make the appropriate selections based on your requirements.

Step 5: Verify the Installation

To verify that MySQL is running correctly, use the following command:


sudo systemctl status mysqld

If MySQL is running, you will see an output with 'active (running)' status.

Step 6: Access MySQL

To access MySQL from the command line, use the following command:


mysql -u root -p

You will be prompted to enter the root password you set during the configuration process. Once logged in, you can start working with your MySQL databases.

That's it! You have successfully installed and configured MySQL on CentOS 8. You can now start using MySQL to build and manage your web applications.

Refer A Friend
Get $25

Installing MySQL
CentOS 8
MySQL installation
MySQL setup
MySQL configuration
CentOS MySQL
MySQL on CentOS
CentOS database installation
CentOS database setup
CentOS MySQL configuration

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.