# 获取rpm
sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
# 直接安装
yum install -y mysql-community-server
# 查看服务
systemctl status mysql
2、安装成功后续
# 安装成功后续# 启动
systemctl start mysqld.service
# 查看状态
systemctl status mysqld.service
# 是否开机启动(默认自启动)
systemctl list-unit-files | grep enabled
# 开机自启动
systemctl enable mysqld
# 查看临时密码
grep "password" /var/log/mysqld.log
# 登录(使用上述临时密码)
mysql -uroot -p
# 密码要符合mysql8安全规则,否则修改不成功
ALTER USER 'root'@'localhost' IDENTIFIED BY '密码';
# 创建用户
create user 'aiops'@'%' identified by'123456';
# 分配远程权限
grant all privileges on *.* to 'aiops'@'%'with grant option;
# 刷新上述权限
flush privileges;
# 默认配置文件
vim /etc/my.cnf
# 如果使用Navicat等客户端连接时报错:caching_sha2_password# mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password# 远程连接请将'localhost'换成'%'# 更改加密方式
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
# 更新用户密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
错误:
问题: cannot install the best candidate for the job
- nothing provides libcrypto.so.10()(64bit) needed by mysql-community-server-8.0.39-1.el7.x86_64
- nothing provides libssl.so.10()(64bit) needed by mysql-community-server-8.0.39-1.el7.x86_64
- nothing provides libcrypto.so.10(libcrypto.so.10)(64bit) needed by mysql-community-server-8.0.39-1.el7.x86_64
- nothing provides libssl.so.10(libssl.so.10)(64bit) needed by mysql-community-server-8.0.39-1.el7.x86_64
- nothing provides libcrypto.so.10(OPENSSL_1.0.2)(64bit) needed by mysql-community-server-8.0.39-1.el7.x86_64
(tryto add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?