文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

MySQL使用rpm包安装

2023-08-22 06:35

关注

安装

  1. 下载mysql rpm 安装包 。选择对应的操作系统版本 官网地址 下载对应的rpm包
mysql-community-common-5.7.29-1.el7.x86_64.rpmmysql-community-libs-5.7.29-1.el7.x86_64.rpmmysql-community-client-5.7.29-1.el7.x86_64.rpmmysql-community-server-5.7.29-1.el7.x86_64.rpm
  1. 依次执行下面命令
rpm -ivh mysql-community-common-5.7.29-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-5.7.29-1.el7.x86_64.rpmrpm -ivh mysql-community-client-5.7.29-1.el7.x86_64.rpmrpm -ivh mysql-community-server-5.7.29-1.el7.x86_64.rpm

报错

➜  tools rpm -ivh mysql-community-libs-5.7.29-1.el7.x86_64.rpmwarning: mysql-community-libs-5.7.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYerror: Failed dependencies:        mysql-community-common(x86-64) >= 5.7.9 is needed by mysql-community-libs-5.7.29-1.el7.x86_64        mariadb-libs is obsoleted by mysql-community-libs-5.7.29-1.el7.x86_64➜  tools rpm -qa | grep mariadbmariadb-libs-5.5.68-1.el7.x86_64➜  tools  rpm -e mariadb-libs-5.5.68-1.el7.x86_64error: Failed dependencies:        libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-9.el7.x86_64        libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-9.el7.x86_64➜  tools  rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
  1. 关于卸载
rpm -qa|grep mysqlrpm -e mysql-community-server-5.7.29-1.el7.x86_64.rpmrpm -e mysql-community-client-5.7.29-1.el7.x86_64.rpmrpm -e mysql-community-libs-5.7.29-1.el7.x86_64.rpmrpm -e mysql-community-common-5.7.29-1.el7.x86_64.rpm

使用

  1. systemctl start mysqld 启动mysql
  2. grep password /var/log/mysqld.log 查看密码
  3. 登录mysql
  4. 修改密码
➜  tools grep password /var/log/mysqld.log2022-09-18T04:02:24.435856Z 1 [Note] A temporary password is generated for root@localhost: YeBPgBelw3_O➜  tools mysql -uroot -PYeBPgBelw3_Omysql: [ERROR] Unknown suffix 'Y' used for variable 'port' (value 'YeBPgBelw3_O')mysql: [ERROR] mysql: Error while setting value 'YeBPgBelw3_O' to 'port'➜  tools mysql -uroot -p YeBPgBelw3_OEnter password:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)➜  tools mysql -uroot -pYeBPgBelw3_Omysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 3Server version: 5.7.29Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
  1. 修改密码

在5.7版本不太友好,密码要求比较严格
如果你想要设置一个简单的测试密码的话,比如设置为root,会提示这个错误,报错的意思就是你的密码不符合要求
警告:由于密码将以明文形式发送到服务器,请使用ssl连接以确保密码安全。

➜  tools mysqladmin -u root -p password "xxxxx"Enter password:mysqladmin: [Warning] Using a password on the command line interface can be insecure.Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.mysqladmin: unable to change password; error: 'Your password does not satisfy the current policy requirements'

修改设置密码的策略

➜  tools mysql -uroot -pYeBPgBelw3_Omysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 10Server version: 5.7.29Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>  set global validate_password_policy=0;Query OK, 0 rows affected (0.00 sec)mysql>  set global validate_password_length=1;Query OK, 0 rows affected (0.00 sec)mysql> exitBye

再次设置密码成功

➜  tools mysqladmin -u root -p password "xxxxx"Enter password:   #输入原始密码mysqladmin: [Warning] Using a password on the command line interface can be insecure.Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.

来源地址:https://blog.csdn.net/Erice_s/article/details/126918365

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯