Jak zainstalować MySQL na CentOS

sudo dnf install mysql-server

Po instalacji wystartowanie serwisu:

sudo systemctl start mysqld.service

Sprawdzenie statusu:

sudo systemctl status mysqld

Włączenie aby MySQL startował po bootowaniu:

sudo systemctl enable mysqld

Dodatkowe czynności:

Zabezpieczanie MySQL:

sudo mysql_secure_installation
Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: Y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2

Testowanie:

mysqladmin -u root -p version
mysqladmin  Ver 8.0.17 for Linux on x86_64 (Source distribution)
 Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
 Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.
 Server version      8.0.17
 Protocol version    10
 Connection      Localhost via UNIX socket
 UNIX socket     /var/lib/mysql/mysql.sock
 Uptime:         2 hours 52 min 37 sec
 Threads: 2  Questions: 20  Slow queries: 0  Opens: 131  Flush tables: 3  Open tables: 48  Queries per second avg: 0.001