Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →The dependable way to install MySQL on CentOS is to use Oracle’s official MySQL Yum repository, select one compatible MySQL release series, install the mysql-community-server package, start the mysqld service, and run mysql_secure_installation. CentOS 7 normally uses yum; dnf-enabled Enterprise Linux systems use dnf. On EL8-based systems, disable the built-in MySQL module before installing repository packages.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
Check the CentOS or Enterprise Linux host first
Repository packages are built for particular Enterprise Linux major releases and CPU architectures. Identify those details before adding a repository; using an RPM for the wrong release can leave the server package unavailable or create dependency conflicts.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errors| Host situation | Package manager | Important preparation |
|---|---|---|
| CentOS 7-era installation | yum |
Use the repository-release RPM intended for the host’s EL7 release and architecture. |
| EL8-based installation | Usually dnf (the yum command may also be present) |
Disable the distribution’s MySQL module before installing from Oracle’s repository. |
| Other dnf-enabled Enterprise Linux systems covered by the repository documentation | dnf |
Match the repository RPM to the exact EL major release and CPU architecture. |
You need administrative access, a working package-manager configuration, and enough disk space for the server and its dependencies. The repository RPM adds Oracle’s repository definition and its GnuPG key, allowing the package manager to verify and retrieve the MySQL RPMs.
Choose one MySQL release series
Oracle publishes each MySQL release series in a separate repository subrepository. The current reference documentation says the latest LTS series is enabled by default. If an application requires another major version, change the repository settings before installation rather than installing first and trying to replace the server later.
#1 Best Overall
- Check the application’s required MySQL major version and compatibility policy.
- Confirm that the selected series has a repository for the host’s EL release and CPU architecture.
- Consider the series’ lifecycle and support policy, not just the newest available package.
- Enable only the one server series you intend to install.
After configuring the repository, inspect the enabled entries. On a Yum host, run:
sudo yum repolist enabled | grep mysql
On a dnf-enabled host, run the equivalent:
sudo dnf repolist enabled | grep mysql
The output should show the intended MySQL series and should not show multiple server release subrepositories enabled at the same time. Oracle’s documentation explicitly advises enabling only one release series. Leaving several enabled allows dependency resolution to select packages from different series and makes future updates unpredictable.
Add Oracle’s MySQL repository
- Determine the host’s Enterprise Linux major version and CPU architecture.
- Open Oracle’s MySQL Yum repository documentation and select the repository-release RPM that matches both values. The RPM is supplied by Oracle and includes the repository definition and signing key.
- Install that downloaded repository-release RPM with the host’s package manager. Use
yumon CentOS 7-era systems anddnfon dnf-enabled systems. - List enabled MySQL repositories with the appropriate
repolistcommand, then select the single release series required by the application.
The exact repository-release filename changes with the EL release, architecture, and available MySQL series, so do not substitute an RPM built for another platform. If the package manager reports an architecture mismatch, stop and obtain the matching repository RPM instead of forcing installation.
Disable the EL8 MySQL module when required
EL8 systems include a distribution MySQL module. That module can mask packages from Oracle’s repository, causing the package manager to report that the desired server package cannot be found or to resolve the wrong source. Disable the module before installing the Community Server package.
With Yum syntax:
sudo yum module disable mysql
With dnf syntax:
sudo dnf module disable mysql
This step applies to EL8-based systems. On a CentOS 7-era host, there is no EL8 module to disable; proceed with repository selection and installation after confirming the enabled subrepository.
Rank #2
Install MySQL Community Server
Once the repository and release series are correct, install the server package. Oracle’s documented package name is mysql-community-server.
Free tools Windows power users keep installed
One-click scans. No signup required.
CentOS 7-era command:
sudo yum install mysql-community-server
Dnf-enabled command:
sudo dnf install mysql-community-server
The package manager also installs the required client, common, and shared-library components. Review the transaction summary before accepting it. The summary should identify packages from the intended MySQL repository, not a distribution module or an unintended release series.
If the command proposes packages from more than one MySQL series, cancel the transaction and correct the repository configuration. Installing while several series are enabled can produce a mixed dependency set that is difficult to maintain.
Start and inspect the mysqld service
Installing the RPM does not replace the need to start the database service. Start the systemd unit named mysqld:
sudo systemctl start mysqld
Immediately inspect its state:
sudo systemctl status mysqld
A healthy result reports that the unit is active and running. The status output is also the first place to look when startup fails because it includes recent service messages and the process exit state.
Use the standard systemd operations when administering the installed server:
sudo systemctl stop mysqldstops the service.sudo systemctl restart mysqldrestarts it after a configuration change or other maintenance action.sudo systemctl status mysqlddisplays the current state and recent messages.
Keep the spelling exact: the service is mysqld, not mysql. A status check for the wrong unit name can make a working installation appear to be missing.
Run mysql_secure_installation
After the service is running, apply the basic hardening supplied with the installation:
sudo mysql_secure_installation
The utility guides you through configuring the root account and removing common insecure defaults. Prompt wording and the questions shown vary with the MySQL release and the initial package state, so read each prompt rather than assuming that every installation presents the same sequence.
Record the credential or authentication choice you make for the administrative account in your normal secure operations process. Do not paste passwords into shell history, support tickets, or game-server configuration files that are readable by other users.
Verify the installation in a controlled order
Use this sequence to separate repository, package, service, and security problems:
- Run the appropriate
repolist enabled | grep mysqlcommand and confirm that exactly one intended MySQL series is enabled. - On EL8, confirm that the built-in MySQL module was disabled before the package transaction.
- Check that the server installation completed without dependency or signature errors.
- Run
sudo systemctl status mysqldand confirm that the service is active and running. - Run
sudo mysql_secure_installationand complete the prompts for the installed release. - Test the client connection using the administrative credentials and authentication method established by the hardening utility before configuring an application.
This order matters: a failed repository selection cannot be repaired by restarting a service, and a running service does not prove that the administrative account has been configured as intended.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot the common installation failures
“No package mysql-community-server available”
- Check the enabled repository list. The MySQL repository-release RPM may not be installed, or its subrepository may be disabled.
- Confirm that the repository RPM matches the host’s EL major version and CPU architecture.
- On EL8, disable the distribution MySQL module and refresh the package metadata before trying the installation again.
- Make sure you selected a release series that is actually published for that platform.
Do not solve this error by enabling every MySQL subrepository. Select the single compatible series and verify the list again.
Recommended Free Tools
The package manager selects a distribution module or the wrong series
This usually indicates that the EL8 module remains enabled or that multiple MySQL release subrepositories are active. Disable the module on EL8 and adjust the repository settings so only the required series is enabled. Recheck the transaction summary before accepting a new installation.
The repository RPM will not install
An architecture or EL-version mismatch is the usual cause. Obtain the repository-release RPM built for the host’s actual platform. Do not force an incompatible RPM or bypass signature checking; the repository package is what supplies the correct repository metadata and GnuPG key.
Best Value
systemctl start mysqld fails
Run sudo systemctl status mysqld and read the recent messages. First confirm that the package transaction completed and that the service name is spelled correctly. If the status output points to a package, configuration, permission, or data-directory problem, correct that specific condition and then retry the start command. Repeatedly restarting without reading the status output does not identify the cause.
The hardening prompts differ from a guide you are following
mysql_secure_installation changes its questions according to the installed MySQL release and package state. Follow the prompts actually displayed by your installation. The utility’s purpose remains the same: configure the root account and remove common insecure defaults, but the exact wording and available choices are not universal.
Choosing a release for an application or game backend
If MySQL will support a self-hosted game service or another application, let that application’s documented compatibility range drive the release choice. A newer LTS series is not automatically the right choice if the application requires an older major version. Check all four decision points before installing:
| Decision point | Question to answer | Why it matters |
|---|---|---|
| Application compatibility | Does the software require a specific MySQL major version? | SQL behavior, authentication, and connectors can differ between major versions. |
| Lifecycle policy | How long will the selected series receive support? | A supported series reduces the need for an avoidable migration during the application’s service life. |
| Repository availability | Is that series published for this EL release and CPU architecture? | A release that is not built for the host cannot be installed through the official repository. |
| Operational consistency | Is exactly one server series enabled? | One enabled series keeps updates and dependency resolution predictable. |
Install the database before pointing the application at it, and test the application’s connection with the credentials and authentication method you configured during hardening. The installation procedure establishes the server; application-specific schemas, users, ports, backups, and performance settings belong to the application’s own deployment documentation.
Copy-and-check installation checklist
- Identify the EL major release and CPU architecture.
- Select the matching Oracle MySQL repository-release RPM.
- Install that RPM and inspect the enabled repository list.
- Enable one MySQL release series only.
- On EL8, run
sudo yum module disable mysqlorsudo dnf module disable mysql. - Install with
sudo yum install mysql-community-serverorsudo dnf install mysql-community-server. - Start the service with
sudo systemctl start mysqld. - Verify it with
sudo systemctl status mysqld. - Run
sudo mysql_secure_installationand follow the prompts shown for your release. - Test an administrative client connection before configuring the application that will use the database.
What a successful result looks like
A complete installation has one compatible MySQL repository series enabled, the Community Server package installed from that repository, an active mysqld systemd service, and a root account processed through mysql_secure_installation. If any one of those conditions is missing, resolve it before treating the CentOS host as ready for an application or game backend.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




