Steps_for_an_Installation_of_MySQL_8_4_1734877849

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Steps for an Installation of MySQL 8.

4 on Red Hat Enterprise Linux 9:

1.Adding the MySQL Yum Repository

a) Download the MySQL Yum Repository page ( https://dev.mysql.com/downloads/repo/yum/ )


in the MySQL Developer Zone.

wget https://dev.mysql.com/get/mysql84-community-release-el9-1.noarch.rpm

b) Install the RPM you downloaded for your system, for example:

$> sudo yum localinstall mysql84-community-release-{platform}-{version-number}.noarch.rpm

c) You can check that the MySQL Yum repository has been successfully added and enabled by
the following command.

$> yum repolist enabled | grep mysql.*-community

2) Installing MySQL:

a) Install MySQL by the following command (for dnf-enabled systems, replace yum in the
command with dnf):

$> sudo yum install mysql-community-server


3) Starting, Stopping and Enable the MySQL Server:

a) Start the MySQL server with the following command:

$> systemctl start mysqld

b) You can check the status of the MySQL server with the following command:

$> systemctl status mysqld

e) To enable instances to run at boot time, do this:

At the initial startup 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:

$> sudo grep 'temporary password' /var/log/mysqld.log


4) mysql_secure_installation — Improve MySQL Installation Security:

a) This program enables you to improve the security of your MySQL installation in the following
ways:

• You can set a password for root accounts.


• You can remove root accounts that are accessible from outside the local host.
• You can remove anonymous-user accounts.
• You can remove the test database (which by default can be accessed by all users, even
anonymous users), and privileges that permit anyone to access databases with names
that start with test_.

5) Check the MySQL connectivity using below command:

mysql -u root -p

You might also like