Home > Article > Operation and Maintenance > Graphical code tutorial on Linux CentOS MySQL database installation and configuration
This article mainly introduces the installation configuration tutorial of Linux CentOS MySQL database in detail. It has certain reference value for those who are interested. You can refer to the notes on installing the mysql database and share it with everyone
a) Download the mysql source installation package
b) Install the mysql source
If Complete! appears at the end, indicating that the MySQL source installation is complete
c) Check whether the installation is complete: yum repo
listenabled | 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 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.logi) Change MySQL password: mysqladmin -u root -p'old password' password 'new password'
There is a problem with changing the password here, the change fails, this is because of the password Too simple a reason. 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) Editconfiguration file
:vim /etc/my.cnf, add this linevalidate_password=off Restart the mysql service after editing: systemctl restart mysqld
j) Set mysql to be accessible remotely:
Log in Enter MySQL: mysql -uroot -p passwordAdd a user to grant access rights: grant all privileges on *.* to 'root'@'ip address' identif
ied by 'password ' with grant option; //You can change the ip to %%, which means opening allOK. I will try to connect locally.
Okay, it’s over here, I wish everyone no bugs.
The above is the detailed content of Graphical code tutorial on Linux CentOS MySQL database installation and configuration. For more information, please follow other related articles on the PHP Chinese website!