赞
踩
Total 8.8 MB/s | 91 MB 00:00:10
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
The GPG keys listed for the “MySQL 8.0 Community Server” repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Failing package is: mysql-community-client-plugins-8.0.35-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
看网上有把关掉这个验证,也去官网看了,走了下官网安装流程,结果还是回到最开始的问题。
# 1.懂的都懂 sudo yum install wget # 2、下载依赖包 # 请注意,这些链接可能会随着MySQL版本的更新而更改。您可以访问下面提供的链接以获取最新版本的下载链接。 # [Yum Repository](https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/) wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql-community-client-8.0.35-1.el7.x86_64.rpm wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql-community-common-8.0.35-1.el7.x86_64.rpm wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql-community-libs-8.0.35-1.el7.x86_64.rpm wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql-community-libs-compat-8.0.35-1.el7.x86_64.rpm wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql-community-server-8.0.35-1.el7.x86_64.rpm wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql-community-client-plugins-8.0.35-1.el7.x86_64.rpm wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql-community-icu-data-files-8.0.35-1.el7.x86_64.rpm # 3、安装所有RPM包 sudo rpm -ivh mysql-community-*.rpm # 4、 安装完成后,启动MySQL服务 sudo systemctl start mysqld
在安装MySQL服务器后,您需要进行一些初始化操作。以下是在安装后首次使用MySQL的步骤:
sudo systemctl start mysqld
root
用户生成一个临时密码。您可以在/var/log/mysqld.log
日志文件中找到它。使用以下命令获取临时密码:sudo grep 'temporary password' /var/log/mysqld.log
记下输出中的临时密码,例如:A_TEMPORARY_PASSWORD
运行mysql_secure_installation
命令以设置MySQL的安全选项。这将引导您完成以下操作:
root
用户的密码root
登录运行以下命令启动安全安装向导:
sudo mysql_secure_installation
在提示时,输入临时密码,然后按照向导的提示操作。
mysql -u root -p
在提示时,输入您在第3步中设置的新密码。
mydb
的新数据库,可以执行以下命令:CREATE DATABASE mydb;
要退出MySQL命令行,输入以下命令:
exit;
django.db.utils.OperationalError: (2059, “Authentication plugin ‘caching_sha2_password’ cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory”)
要解决这个问题,你可以将Django使用的MySQL用户的认证插件更改为mysql_native_password。以下是操作步骤:
# 登录到数据库
mysql -u root -p
# 切換到mysql这个库
USE mysql;
# 更改Django使用的MySQL用户的认证插件。例如,如果你的用户名是django,你可以运行以下命令
# 其中,'django_password'是你的Django用户的密码。
ALTER USER 'django'@'localhost' IDENTIFIED WITH mysql_native_password BY 'django_password';
# 刷新权限
FLUSH PRIVILEGES;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。