CentOS7使用yum命令的时候报错:File contains no section headers
报错截图:
解决方法:
1. 删除改目录下的文件,如果不放心的话,可以使用mv备份
rm -f /etc/yum.repos.d/*
2. 重新创建目录
mkdir /etc/yum.repos.d
3. 重新下载
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4. 清除缓存
yum clean all
下载安装包失败:Error downloading packages:2:container-selinux-2.119.2-1.911c772.el7_8.noarch: [Errno 256] No more mirrors to try.
报错截图:
解决方法:
1. 先清除yum
yum clean all
2. 建立yum元数据缓存 ,然后再运行命令即可
yum makecache
进入MySQL时报错
报错内容如下:
root@c81c7e1608ea:/# mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
解决方法:
root@c81c7e1608ea:/# mysql -h localhost -p
Last_IO_Error: error connecting to master 'slave1@192.168.15.8:3307' - retry-time: 30 retries: 1 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
解决方法:把MySQL用户的身份认证规则设置为mysql_native_password
ALTER USER 'slave1'@'%' IDENTIFIED WITH mysql_native_password BY '123456';