MySQL installation under CentOS 7

MySQL installation under CentOS 7

1. Guide package

Windows
Insert picture description here
CentOS
Insert picture description here

Two, install MySQL

Install perl
yum install perl -y
Insert picture description here
install client
rpm -ivh MySQL-client-5.6.46-1.el7.x86_64.rpm
Insert picture description here
install autoconf
yum install autoconf -y
Insert picture description here
install server-side
rpm -ivh MySQL-server-5.6.46-1 .el7.x86_64.rpm
Insert picture description here
remember the last line of
Insert picture description here
uninstall
rpm -e mariadb-libs-1:5.5.68-1.el7.x86_64 --nodeps
and reinstall the server side
rpm -ivh MySQL-server-5.6.46-1 .el7.x86_64.rpm
Insert picture description here
after successful installation
Insert picture description here

Find MySQL initial password

Enter the [.mysql_secret] file to view the last string of English strings [: the latter]
vi /root/.mysql_secret
Insert picture description here

Three, run MySQL

service mysql start-service start
Insert picture description here
mysql-start mysql program

mysql -u username -p password-login
Insert picture description here
set password=password("password");-modify the password
[Note: all at the end of the mysql statement;]
After the modification, use: quit; exit and
Insert picture description here
log in again with the new password
Insert picture description here

Fourth, the problems encountered during installation

What should I do if I want to reinstall the wrong installation? Be sure to uninstall clean
1. Use yum to install mysql, use the following command to uninstall
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysq
rm /etc/my.cnf

2. Use the mysql installed by rpm, use the following command to uninstall
rpm -qa | grep -i mysql

Use the rpm -e command to uninstall the package list in the previous command one by one.

Delete mysql service
chkconfig --list | grep -i mysql
chkconfig --del mysql

Then find out the scattered mysql folders in the OS and delete them.

find / -name mysql
rm -rf these files

Try to try both! ! !

Guess you like

Origin blog.csdn.net/qq_43288259/article/details/113871162