Get the App
SLTechnology News&Howtos  ›  Database  › 

Example of CentOS MySQL database installation configuration in Linux

Shulou Source: shulou.com Published: 2022-05-31 23:48:30 10月13日 Update

This article will explain in detail the examples of installation and configuration of CentOS MySQL database in Linux. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Install the mysql database notes and share them with you

A) download the mysql source installation package: wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

B) install MySQL source: yum localinstall mysql57-community-release-el7-8.noarch.rpm

If completeness appears at the end, the installation of the MySQL source is complete

C) check whether the installation is complete: yum repolist enabled | grep "mysql.*-community.*"

D) install mysql:yum install mysql-community-server

If complete appears at the end, the MySQL installation is complete.

E) set to enable and start mysql service: systemctl enable mysqld

F) check the installed mysql version: rpm-aq | grep-I mysql

G) start the MySQL service: systemctl restart mysqld

H) View MySQL initial password: grep'a temporary password' / var/log/mysqld.log

I) change the MySQL password: mysqladmin-u root-p 'old password' password 'new password'

There is a problem with changing the password here, and the change fails because the password is too simple. There are two alternative solutions:

Method 1: set the password to be more complex (this is the most direct way)

Method 2: turn off mysql password strength authentication (validate_password)

Edit the configuration file: vim / etc/my.cnf, add this line of validate_password=off

Restart the mysql service after editing: systemctl restart mysqld

J) set mysql to be accessible remotely:

Log in to the MySQL:mysql-uroot-p password

Add a user to give access: grant all privileges on *. * to 'root'@'ip address' identified by 'password' with grant option; / / change ip to%%, indicating that all

OK, I'll try to connect locally.

All right, it's over here. I wish you all no BUG.

This is the end of this article on "examples of installation and configuration of CentOS MySQL database in Linux". I hope the above can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Password method data database configuration article service example more this is good complex practical one line two content reason address strength file Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft OPPO Reno NVidia MariaDB