new一个奶黄包:能治愈你的只有努力
这里没有安装过
http://repo.mysql.com/
我的是7.9版本那么就要7.9及以上即可
sudo apt-get install lrzsz //安装指令
直接找到文件上传即可
//获取源文件
get -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
//安装源文件指令
[root@localhost MySql]# yum install -y mysql57-community-release-el7-10.noarch.rpm
[root@localhost MySql]# yum install -y mysql-community-server
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
//解决密钥问题
[root@localhost MySql]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
[root@localhost MySql]#ls /etc/my.cnf
[root@localhost MySql]#ls /var/lib/mysql
[root@localhost MySql]#whilch mysql
[root@localhost MySql]#systemctl start mysqld
[root@localhost MySql]# yum list |grep mysql
[root@localhost MySql]# vim /etc/my.cnf
//skip-grant-tables配置
[root@localhost MySql]#systemctl restart mysqld //配置号即可
[root@localhost MySql]# mysql -uroot -p
ctrl+D
systemctl enable mysqld //一直启动启动
systemctl daemon-reload //重新加载 systemd
[root@localhost MySql]# rpm -qa |grep mariadb | xargs yum -y remove
[root@localhost MySql]# rpm -qa |grep mysql | xargs yum -y remove
通过管道的方式将mariadb的文件依次追加到remove后面实现连续删除