mysql is one of the oldest and most trusted open source relational database management systems trusted by millions of users and used daily. Since Felt recently announced its new version of the flagship distribution, we will explain how you can easily install MySQL 8 in Fedora 36.
Throughout this tutorial we will be using the default Felt repositories so that we can make this installation process as easy as possible.
Important: mysql and MariaDB the packages provide similar files and will conflict with each other. For this reason, you should only install mysql Where MariaDB but not both.
Install MySQL in Fedora Linux
Before installing a package on your system, updating your repositories and applying updates (if applicable) ensures a robust experience. We will update the repositories by the given dnf command:
$ sudo dnf update
Once the repositories are updated, we can move on to the installation part. Since we’ll be using the default repository, it saves us more complex steps. As we want to have the most recent version of mysqlwe will use the community version.
To install mysqluse the given command:
$ sudo dnf install community-mysql-server -y
As we use dnfit will automatically manage all dependencies and give us a hassle-free experience.
Start MySQL in Fedora Linux
I just installed mysql won’t do your job. Before we go any further, we need to enable mysql service because it will be in an idle state after installation.
To check the current status of the mysql service, use the given command:
$ systemctl status mysqld
We will use the following command to start the mysql service:
$ sudo systemctl start mysqld
Now let’s check if we started successfully mysql using the given command:
$ systemctl status mysqld
As you can see, mysql runs in an active state.
Likewise, if you want to start mysql on every boot, you can easily do this using the given command:
$ sudo systemctl enable mysqld
Securing MySQL in Fedora Linux
The default installation of mysql is weak by modern security standards and can easily be manipulated by hackers. There are several ways to secure your MySQL, but the simplest yet most effective is to use a secure script.
You can easily start the security script with the following command:
$ sudo mysql_secure_installation
For most users this script will work fine but if it asks you for the password you can retrieve a temporary password from mysqld.log at /var/log/ by the given command:
$ sudo grep 'temporary password' /var/log/mysqld.log
The secure script will ask you the following:
- Configuring a root password
- Deleting anonymous users
- Disable root access via remote
- Deleting the test database
- Reloading root privileges
Connecting to MySQL in Fedora Linux
Once we are done securing the script, we can easily connect to the mysql server by the given command:
$ sudo mysql -u root -p
Once we are in mysqlwe can list databases using the following:
mysql> SHOW DATABASES;
Update MySQL in Fedora Linux
Despite the fact that we have just completed the installation recently, we can use the following command to update mysql some products:
$ sudo dnf update mysql-server
This was our take on how easily you can install MySQL 8 on Fedora 36 in the simplest way possible. But if you are still facing installation issues, feel free to ask in the comment section.