liunx安装MySQL 报错误(错误:依赖检测失败:mysql-community-common(x86-64) >= 5.7.9 被 mysql-community-libs-5.7.离线安装)
今天安装MySQL(离线)的时候,发现安着安着,就出问题了,在网上找了解决方法,所以分享一下给大家
报错内容
我是在把压缩包放到liunx 之后,解压,往下操作的时候出的错
[root@localhost mysql]# tar -xvf mysql-5.7.30-1.el7.x86_64.rpm-bundle.tarmysql-community-common-5.7.30-1.el7.x86_64.rpmmysql-community-server-5.7.30-1.el7.x86_64.rpmmysql-community-test-5.7.30-1.el7.x86_64.rpmmysql-community-client-5.7.30-1.el7.x86_64.rpmmysql-community-embedded-5.7.30-1.el7.x86_64.rpmmysql-community-libs-5.7.30-1.el7.x86_64.rpmmysql-community-devel-5.7.30-1.el7.x86_64.rpmmysql-community-embedded-compat-5.7.30-1.el7.x86_64.rpmmysql-community-embedded-devel-5.7.30-1.el7.x86_64.rpmmysql-community-libs-compat-5.7.30-1.el7.x86_64.rpm
安装
rpm -ivh mysql-community-common-5.7.23-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-5.7.23-1.el7.x86_64.rpmrpm -ivh mysql-community-client-5.7.23-1.el7.x86_64.rpm//安装之前,请先检查是否安装libaio,如果未安装请先安装之后再装server源rpm -qa|grep libaiorpm -ivh mysql-community-server-5.7.23-1.el7.x86_64.rpm
因为这是我在不同的虚拟机里面安装MySQL,所以执行顺序要发生了改变,因为这些包有依赖顺序,而且版本有先后
rpm -ivh mysql-community-server-5.7.30-1.el7.x86_64.rpm --force --nodepsrpm -ivh mysql-community-common-5.7.30-1.el7.x86_64.rpm --force --nodepsrpm -ivh mysql-community-libs-5.7.30-1.el7.x86_64.rpm --force --nodepsrpm -ivh mysql-community-client-5.7.30-1.el7.x86_64.rpm --force --nodeps
systemctl start mysqld // 启动
systemctl status mysqld // 查看状态
查看临时密码:
grep password /var/log/mysqld.log
例如我这个的临时密码就是 hhrcu5nV-A(z
然后使用 mysql -u root -p 回车 输入临时密码
进入之后分别使用
set global validate_password_policy=0;
set global validate_password_length=1;
alter user 'root'@'localhost' identified by '123456';
开启远程连接
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
firewall-cmd --zone=public --query-port=3306/tcp
- firewall-cmd --zone=public --add-port=3306/tcp --permanent
- firewall-cmd --reload
- firewall-cmd --zone=public --query-port=3306/tcp
然后查看mysql是否启动成功
systemctl status mysqld
然后测试连接
来源地址:https://blog.csdn.net/xsjdyty/article/details/129841276
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341