linux mysql源,linux 安装 mysql8+ rpm源方式

系统 更新

yum upgrade

卸载

rpm -qa|grep -i mysql

rpm -ev mysql-community-common-5.7.27-1.el7.x86_64 mysql-community-server-5.7.27-1.el7.x86_64 mysql-community-server-5.7.27-1.el7.x86_64 mysql-community-libs-5.7.24-1.el7.x86_64 mysql-community-client-5.7.24-1.el7.x86_64 mysql-community-libs-compat-5.7.24-1.el7.x86_64 postfix-2:2.10.1-7.el7.x86_64 postfix-2:2.10.1-7.el7.x86_64 redhat-lsb-core-4.1-27.el7.centos.1.x86_64

rpm -ev mysql80-community-release-el7-1.noarch

删除目录

find / -name mysql

rm -rf /var/lib/mysql

rm -rf /etc/selinux/targeted/active/modules/100/mysql

rm -rf /usr/share/mysql

rm -rf /etc/my.cnf

验证

rpm -qa|grep -i mysql

find / -name mysql

安装 mysql-rpm:

wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

yum localinstall mysql80-community-release-el7-1.noarch.rpm

2.安装mysql-community-release-el7-5.noarch.rpm包

输入指令:sudo rpm -ivh mysql80-community-release-el7-1.noarch.rpm

3.安装mysql

输入指令:sudo yum install mysql-server

登录

输入指令:service mysqld restart

随机密码

输入指令:grep 'temporary password' /var/log/mysqld.log

mysql -uroot -p

5修改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

FLUSH PRIVILEGES;

use mysql;

select host, user from user;

update user set host='%' where user='root';

select host, user from user;

exit;

6 重启 修改权限

systemctl restart mysqld

mysql -uroot -p123456

ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '514840279@qq.com';

exit;

systemctl restart mysqld

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值