uname -a
# 查看相關包 rpm -qa | grep mariadb # 卸載相關包 rpm -e 查出來的包名,有依賴的一塊兒刪掉就行
https://downloads.mysql.com/archives/community/
mysql
將下載的包上傳到服務器上
順序已經列出來了,不要錯了
rpm -ivh mysql-community-common-8.0.23-1.el7.x86_64.rpm rpm -ivh mysql-community-client-plugins-8.0.23-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-8.0.23-1.el7.x86_64.rpm rpm -ivh mysql-community-client-8.0.23-1.el7.x86_64.rpm rpm -ivh mysql-community-server-8.0.23-1.el7.x86_64.rpm
mysqladmin --version
默認的dataDir是對不上的。。須要修改下
vim /etc/my.cnf
datadir=/var/lib/mysql/mysql
systemctl start mysqld
systemctl status mysqld
cat /var/log/mysqld.log | grep password
mysql -u root -p
alter user root@localhost identified by 'Root_123456';
SHOW VARIABLES LIKE 'validate_password%';
set global validate_password.policy = low; set global validate_password.length = 4;
alter user root@localhost identified by '123456';
update user set host='%' where host='localhost';
systemctl restart mysqld;