MySQL is a free, open-source database management system using SQL to maintain and query databases that has been around for over 20 years. Databases are an essential part of many websites and web servers, and are also used for analyzing large amounts of data in an efficient way. MySQL is a standard part of the LAMP stack, which is a collection of open-source web applications including Linux, Apache, MySQL, and PHP. This makes it a popular choice for web development projects.
This guide will walk you through install MySQL on four operating systems: CentOS, RedHat, Ubuntu, and Windows 10.
Install MySQL on CentOS 7
CentOS is a fast, simple open-source Linux operating system with a graphical user interface that can be disabled to increase security. The default database management system is MariaDB. Using the Yum command to install MySQL will install MariaDB, although the two are almost interchangeable.
To install MySQL on CentOS 7, you’ll need a user with sudo privileges and to have the yum server configured.
- Navigate to MySQL’s website and select the “Downloads” tab. This will take you to a list of all the available MySQL downloads.
- Scroll down to the “MySQL Community (GPL) Downloads” link and select it. The community download is the open-source free version of MySQL. MySQL also offers other products with the same functionality combined with customer support.

- Select the option for “MySQL Yum Repository”.

- Find the “Red Hat Enterprise Linux 7 / Oracle Linux 7” version and either download it from the browser, or open a terminal and complete the next steps.
- Type the following code into the terminal. Check the version number matches the most up to date version on the list of downloads on MySQL’s website, and adjust the name if necessary.

- Next, prepare the repository using the code below. This will enable the installation of the MySQL packages in the next step.

- The next step is to use the yum install command with the code below in the terminal:

- When the script asks for confirmation, type “y” in the command line. It will ask for your input a few times. Once it’s finished, it will show a “Complete” message to tell you all the packages were installed.
For other versions, the process is very similar. Swap out the version numbers to use a different set of packages.
Install MySQL on Redhat 9
Redhat is another Linux-based operating system using a subscription payment model. It’s one of the most popular Linux operating systems due to its long history of stability, reliability and solid customer support.
The process for installing MySQL on Redhat is simple and straightforward. Note that you can’t have MariaDB and MySQL installed at the same time, they conflict with each other.
- The first step is to get and install the MySQL packages by typing the following into the terminal:

- Next, start MySQL with the next line of code:

- You can also set MySQL to start when booting up RedHat by entering the command below:

RedHat makes it very simple to install MySQL since it’s a critical part of most servers and websites. You’ll want to configure your installation once it’s complete to ensure its secure.
Install MySQL on Ubuntu 20.04
Like CentOS, Ubuntu is another fast, free, open-source Linux operating system with good stability and a high level of security.
Installing MySQL on Ubuntu is very similar to installing it on RedHat, although the commands are a little different. Ubuntu uses the APT package repository.
- Update your package index with the following code in your terminal:

- Install the MySQL packages by typing in the next line:

- Finally, start the MySQL service by typing the following code in:

Like with the other operating systems, you’ll want to configure this install by adding a password and other details to secure your installation.
Install MySQL on Windows 10
Perhaps the most well-known operating system in use today, Windows 10 is used across individual consumers, enterprises, and governments for computers and servers. To install MySQL’s open-source community edition on Windows 10, follow the instructions below:
- Check if Microsoft Visual C++ 2019 Redistributable Package is installed. It should be listed under Apps & features in the Settings menu. If not, download and install it from the Microsoft Download Center.
- Navigate to MySQL’s website and select the “Downloads” tab. This will take you to a list of all the available MySQL downloads.

- Scroll down to the “MySQL Community (GPL) Downloads” link and select it. The community download is the open-source free version of MySQL. MySQL also offers other products with the same functionality combined with customer support.

- Select the option for “MySQL Installer for Windows”.

- Press the “Download” button to download the installer. There are two different download options here, the first is a web downloader and the second an offline install. This guide uses the web installer, but the process for the offline installer is about the same. The only difference is the offline installer downloads all the components ahead of time, while the web installer lets you choose which options to download.

- Log in or sign up for an Oracle Web account, or choose “No thanks, just start my download” to skip making an account. Having an Oracle Web account is not required to download and use MySQL.

- Open the downloads folder in your browser and run the installation package. The location of the downloads folder will vary depending on the browser you’re using. Alternatively you can find the installation package file in your downloads folder in Windows.
- Select “Yes” to the Windows popups asking if you want to allow the installation package to make changes to your computer.
- Choose your setup type and click “Next”. Follow the prompts of the installer to select the options you need for your projects.

- Press “Execute” to start the download. The installer will download the components you selected. Once finished, click “Next”.

- Click “Execute” on the next page to install the components you just downloaded. When the installation is complete, select “Next” to configure the product.

- Follow the prompts to configure the products you’ve installed. You can close the installation wizard at this point and complete the configuration later if necessary. The configuration is necessary at some point to ensure your installation is secure.
This completes the MySQL install on Windows 10.
You’re now ready to use MySQL on any of the four above operating systems. You can also read another article on How to Install Latest Vim editor in Linux/