Installing MySQL Install MySQL by the following command (for Fedora, replace yum in the command with dnf):
shell> sudo yum install mysql-community-server
This installs the package for MySQL server (mysql-community-server) and also packages for the components required to run the server, including packages for the client (mysql-community-client), the common error messages and character sets for client and server (mysql-community-common), and the shared client libraries (mysql-community-libs).
Starting the MySQL Server Start the MySQL server with the following command:
shell> sudo service mysqld start
Starting mysqld:[ OK ]
You can check the status of the MySQL server with the following command:
shell> sudo service mysqld status
mysqld (pid 3066) is running.
At the initial start up of the server, the following happens, given that the data directory of the server is empty:
The server is initialized.
SSL certificate and key files are generated in the data directory.
validate_password is installed and enabled.
A superuser account 'root'@'localhost is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:
shell> sudo grep 'temporary password' /var/log/mysqld.log
Change the root password as soon as possible by logging in with the generated, temporary password and set a custom password for the superuser account:
shell> mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';