东拼西凑记录一下
centos有的需要更新yum
备份repo
mv /etc/yum.repos.d /etc/yum.repos.d.bak
创建文件
mkdir -p /etc/yum.repos.d
下载新的yum源
curl https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo > /etc/yum.repos.d/Centos-vault-8.5.2111.repo
curl https://mirrors.aliyun.com/repo/epel-archive-8.repo > /etc/yum.repos.d/epel-archive-8.repo
装mysql
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
yum clean all && yum makecache
yum install -y mysql-community-server
All matches were filtered out by modular filtering for argument: mysql-community-server
这个报错 执行这个命令
yum module disable mysql
然后在安装
yum install mysql-community-server
systemctl start mysqld.service systemctl enable mysqld
启动不了 找不到mysql服务执行这个
yum -y install mysql-community-server --nogpgcheck
cat /var/log/mysqld.log | grep password
ky1u)s4+cNKT
改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'xx!';
配置远程
#设置root 用户远程访问: update user set host = '%' where user ='root';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';