Home >Database >Mysql Tutorial >Linux CentOS MySQL database installation and configuration example sharing
This article mainly introduces the installation and configuration tutorial of Linux CentOS MySQL database in detail. It has certain reference value. Interested friends can refer to it. I hope it can help everyone.
Notes on installing mysql database, share with everyone
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 complete! appears at the end, the MySQL source installation 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 up and start the 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) Check the MySQL initial password: grep 'A temporary password' /var/log/mysqld.log
i) Change MySQL password: mysqladmin -u root -p'old password' password 'new password'
There is a problem with changing the password here and the change fails. This is because the password is too simple. There are two direct solutions:
Method one: Make the password more complicated (this is the most direct method)
Method two: Turn off mysql password strength verification (validate_password)
Edit the configuration file: vim /etc/my.cnf, add this line validate_password=off
Restart the mysql service after editing: systemctl restart mysqld
j) Set mysql to be accessible remotely:
Log in to MySQL: mysql -uroot -p password
Add a user to grant access rights: grant all privileges on *.* to 'root'@'ip address' identified by 'password' with grant option; //You can change the ip to %%, which means opening all
OK, I will try to connect locally.
Okay, it’s over here, I wish everyone no bugs.
Related recommendations:
Detailed explanation of the mysql startup item in the service after the mysql database is installed
Mysql database installation and Usage tutorial
The above is the detailed content of Linux CentOS MySQL database installation and configuration example sharing. For more information, please follow other related articles on the PHP Chinese website!