How to Install MySQL 8.4 on Fedora
Install MySQL 8.4 from Fedora’s native packages with DNF, start the mysqld service, and create a database.
On this page
Fedora 43 and 44 currently provide MySQL 8.4 through the mysql-server package. The exact version can vary by Fedora release, so check the installed version after setup. See the Fedora MySQL server package page for current package details.
This tutorial installs MySQL from Fedora’s native repositories; it does not require enabling a separate MySQL repository.
Prerequisites
Before you install MySQL, you need to have the following prerequisites:
- Fedora 43 or 44 workstation or server
- Non-root user with sudo privileges
- Internet connection
Step 1 - Install MySQL
Install the server package from Fedora’s repositories:
sudo dnf install mysql-server
Confirm the installed version:
mysql --version
Step 2 - Start MySQL Service
Start MySQL and enable it at boot:
sudo systemctl enable --now mysqld
Step 3 - Secure MySQL Server
It is recommended to run the mysql_secure_installation script to improve MySQL security:
sudo mysql_secure_installation
This will set the root password, remove anonymous user accounts, disable root logins outside localhost etc.
Step 4 - Create a Dedicated MySQL User
It’s best practice to create a dedicated user instead of using root:
-- Run as an administrator before logging in with the application account.
CREATE DATABASE IF NOT EXISTS mytestdb;
-- MySQL 8.0.18+ returns a generated password; save it securely for the connection test.
CREATE USER 'myuser'@'localhost' IDENTIFIED BY RANDOM PASSWORD;
-- CREATE is included for the sample table; use a separate migration account for schema changes in production.
GRANT CREATE, SELECT, INSERT, UPDATE, DELETE ON mytestdb.* TO 'myuser'@'localhost';
Step 5 - Test MySQL
Connect to MySQL shell with the new user:
mysql -u myuser -p
Run a test command:
SHOW DATABASES;
Step 6 - Create a Sample Table
Create a table in the sample database:
USE mytestdb;
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
email VARCHAR(50)
);
MySQL 8.4 is now ready to use!
Conclusion
We have demonstrated how to install MySQL 8.4 on Fedora from the native repositories. You can now start developing applications using MySQL on your Fedora desktop or server.
If you want to learn more about MySQL, please use our MySQL tutorials and MySQL Reference.