Installing MySQL 8.0 On Fedora 28/27/26


This article will guide you to install MySQL 8.0 on Fedora 28/27/26

System update

Log in and update the system with the following command

sudo dnf update

Install Yum Repository

To install the yum repository for the MySQL server on Fedora we create the yum repository file as follows:

vim /etc/yum.repos.d/mysql-community.repo

File content:

name = MySQL 8.0 Community Server
baseurl = http: //$releasever/$basearch/
enabled = 1
gpgcheck = 1
gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-mysql

Then save and proceed to the next step

Install MySQL Server

Run the following command to proceed with the installation

sudo dnf install mysql-community-server

Start and set MySQL to start automatically on the system using the following command:

sudo systemctl enable mysqld.service
sudo systemctl start mysqld.service

Configure MySQL

After installing MySQL will generate a random password for the root user, we use the following command to get the password:

grep 'A temporary password is generated' /var/log/mysqld.log | tail -1
2018-10-16T11:49:31.216147Z 1 [Note] A temporary password is generated for [email...]: ,yJrusM58kW7

As above the password would be  :, yJrusM58kW7

Execute the following command to configure MySQL

sudo mysql_secure_installation

Select Y to change the password for root, then continue to choose Y with the rest of the settings

Change the password for root? - Press y and change root password

Remove anonymous users? Press y

Disallow root login remotely? Press y

Remove test database and access to it? (Press y

Reload privilege tables now? Press y

MySQL connection

After the installation and configuration is complete we use the following command to try to connect to the MySQL server

mysql -u root -p

Type in the new password you have changed, if the screen shown below appears, the installation was successful.

If you want to remote from another machine to the MySQL server you just installed, you have to create a remote user and grant it permissions. For example:

CREATE USER 'remoteuser' @ '%' IDENTIFIED BY 'izzidb_pass';

GRANT ALL ON *. * To remoteuser @ '%' IDENTIFIED BY 'izzidb_pass';


Then you can connect to the MySQL server via port 3306 with the username remoteuser and password: izzidb_pass