This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10090|Reply: 1

[Source] CentOS 7 uses rpm to install the MySQL database

[Copy link]
Posted on 2022-1-23 23:19:32 | | | |
Requirements: Install the MySQL 5.7.36 Community Release database on a CentOS 7 system.

Review:

Linux View the MySQL configuration file path and related configurations
https://www.itsvse.com/thread-7402-1-1.html

CentOS 7 offline installation of rpm packages automatically resolves dependencies
https://www.itsvse.com/thread-9951-1-1.html
Preparation

Before installing the MySQL database, CentOS 7 needs to do some preparation and install the required dependencies with the following commands:

Uninstall mariadb

If you do not uninstall it, when installing the libs package, you will get the following error:

error: Failed dependencies:
        mysql-community-common(x86-64) >= 5.7.9 is needed by mysql-community-libs-5.7.36-1.el7.x86_64
        mariadb-libs is obsoleted by mysql-community-libs-5.7.36-1.el7.x86_64
Review and uninstall


Download and unzip mysql-5.7.36

Download Address:The hyperlink login is visible.Select the required version, operating system, and system version, as shown in the following figure:



Download the unzip command as follows:


Start installing mysql-5.7.36

Run the following command to install:



Start MySQL

After the installation is completed, the MySQL service is booted by default, and the command to start the MySQL service is as follows:

To view the temporary password, the command is as follows:



To connect to a MySQL database, users before MySQL version 5.7.6 can use the following command to change the default password:



If you do not set a new password, the error will be as follows:

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
If the password does not meet the requirements, the following error will be reported:

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
Create a new oneRoot accounts that allow remote connections, the command is as follows:


Allows access to port 3306

The default port of the MySQL database is 3306, if the firewall is enabled, you need to release port 3306 to allow external clients to access, and the command is as follows:

Try using the MySQL database connection tool, using dbeaver as an example, the connection is successful, as shown in the following figure:



MySQL configuration

If you need to tune MySQL and modify some configuration items of the service, edit the following file:

/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
(End)





Previous:Issue with Hikvision's deployment of dynamic link libraries on Linux systems
Next:Practical use cAdvisor to collect Docker container metrics
 Landlord| Posted on 2024-4-12 14:47:10 |
CentOS 7 with MySQL 8.0.36 installed




Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com