linux系统使用yum安装mysql5.6版本的流程

news2024/9/21 14:41:03

1.下载安装包及依赖包

MySQL :: Download MySQL Community Server (Archived Versions)

[root@localhost localrepo]# ls
MySQL-client-5.6.47-1.el7.x86_64.rpm    
MySQL-server-5.6.47-1.el7.x86_64.rpm         
MySQL-test-5.6.47-1.el7.x86_64.rpm
MySQL-devel-5.6.47-1.el7.x86_64.rpm     
mysql-shared-5.6.47-1.el7.x86_64.rpm         
MySQL-embedded-5.6.47-1.el7.x86_64.rpm  
MySQL-shared-compat-5.6.47-1.el7.x86_64.rpm

2.把上述的rpm文件都使用yum -y install ./xx.rpm安装

注意: client和server的rpm包应该在最后安装

比如:

[root@localhost ~]# yum -y install MySQL-embedded.x86_64
仓库 'local_repo' 在配置中缺少名称,将使用 id。
上次元数据过期检查:0:00:34 前,执行于 2024年08月23日 星期五 13时21分33秒。
错误:
 问题: 冲突的请求
  - 没有东西可提供 libncurses.so.5()(64bit)(MySQL-embedded-5.6.47-1.el7.x86_64 需要)
  - 没有东西可提供 libtinfo.so.5()(64bit)(MySQL-embedded-5.6.47-1.el7.x86_64 需要)
(尝试添加 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用软件包的最佳候选)
[root@localhost ~]# yum -y install MySQL-shared.x86_64
仓库 'local_repo' 在配置中缺少名称,将使用 id。
上次元数据过期检查:0:00:51 前,执行于 2024年08月23日 星期五 13时21分33秒。
依赖关系解决。
=============================================================================================================================================================
 软件包                                 架构                             版本                                     仓库                                  大小
=============================================================================================================================================================
安装:
 MySQL-shared                           x86_64                           5.6.47-1.el7                             local_repo                           4.1 M

事务概要
=============================================================================================================================================================
安装  1 软件包

总计:4.1 M
安装大小:17 M
下载软件包:
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                                                                                              1/1
  安装    : MySQL-shared-5.6.47-1.el7.x86_64                                                                                                             1/1
  运行脚本: MySQL-shared-5.6.47-1.el7.x86_64                                                                                                             1/1
  验证    : MySQL-shared-5.6.47-1.el7.x86_64                                                                                                             1/1

已安装:
  MySQL-shared-5.6.47-1.el7.x86_64

完毕!

注意: 有警告需要安装 libtinfo.so.5

[root@localhost ~]# yum provides libtinfo.so.5
仓库 'app' 在配置中缺少名称,将使用 id。
仓库 'base' 在配置中缺少名称,将使用 id。
仓库 'local_repo' 在配置中缺少名称,将使用 id。
app                                                                                                                          128 MB/s | 7.8 MB     00:00
base                                                                                                                         107 MB/s | 2.6 MB     00:00
local_repo                                                                                                                   1.7 MB/s |  63 kB     00:00
ncurses-compat-libs-6.1-9.20180224.el8.i686 : Ncurses compatibility libraries
仓库        :base
匹配来源:
提供    : libtinfo.so.5

[root@localhost ~]# yum -y install ncurses-compat-libs-6.1-9.20180224.el8.i686
仓库 'app' 在配置中缺少名称,将使用 id。
仓库 'base' 在配置中缺少名称,将使用 id。
仓库 'local_repo' 在配置中缺少名称,将使用 id。
上次元数据过期检查:0:00:16 前,执行于 2024年08月23日 星期五 13时23分56秒。
依赖关系解决。
=============================================================================================================================================================
 软件包                                       架构                          版本                                         仓库                           大小
=============================================================================================================================================================
安装:
 ncurses-compat-libs                          i686                          6.1-9.20180224.el8                           base                          346 k
安装依赖关系:
 glibc                                        i686                          2.28-189.1.el8                               base                          2.0 M
 libgcc                                       i686                          8.5.0-10.el8                                 base                           86 k
 libstdc++                                    i686                          8.5.0-10.el8                                 base                          489 k

事务概要
=============================================================================================================================================================
安装  4 软件包

总计:2.9 M
安装大小:7.9 M
下载软件包:
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                                                                                              1/1
  安装    : libgcc-8.5.0-10.el8.i686                                                                                                                     1/4
  运行脚本: libgcc-8.5.0-10.el8.i686                                                                                                                     1/4
  运行脚本: glibc-2.28-189.1.el8.i686                                                                                                                    2/4
  安装    : glibc-2.28-189.1.el8.i686                                                                                                                    2/4
  运行脚本: glibc-2.28-189.1.el8.i686                                                                                                                    2/4
  安装    : libstdc++-8.5.0-10.el8.i686                                                                                                                  3/4
  运行脚本: libstdc++-8.5.0-10.el8.i686                                                                                                                  3/4
  安装    : ncurses-compat-libs-6.1-9.20180224.el8.i686                                                                                                  4/4
  运行脚本: ncurses-compat-libs-6.1-9.20180224.el8.i686                                                                                                  4/4
  验证    : glibc-2.28-189.1.el8.i686                                                                                                                    1/4
  验证    : libgcc-8.5.0-10.el8.i686                                                                                                                     2/4
  验证    : libstdc++-8.5.0-10.el8.i686                                                                                                                  3/4
  验证    : ncurses-compat-libs-6.1-9.20180224.el8.i686                                                                                                  4/4

已安装:
  glibc-2.28-189.1.el8.i686         libgcc-8.5.0-10.el8.i686         libstdc++-8.5.0-10.el8.i686         ncurses-compat-libs-6.1-9.20180224.el8.i686

完毕!

3.继续安装rpm包

4.最后安装server的rpm包会提示临时密码:

[root@localhost localrepo]# yum -y install MySQL-server-5.6.47-1.el7.x86_64.rpm
仓库 'app' 在配置中缺少名称,将使用 id。
仓库 'base' 在配置中缺少名称,将使用 id。
仓库 'local_repo' 在配置中缺少名称,将使用 id。
上次元数据过期检查:0:03:18 前,执行于 2024年08月23日 星期五 13时23分56秒。
依赖关系解决。
=============================================================================================================================================================
 软件包                                 架构                             版本                                   仓库                                    大小
=============================================================================================================================================================
安装:
 MySQL-server                           x86_64                           5.6.47-1.el7                           @commandline                            86 M

事务概要
=============================================================================================================================================================
安装  1 软件包

总计:86 M
安装大小:351 M
下载软件包:
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                                                                                              1/1
  运行脚本: MySQL-server-5.6.47-1.el7.x86_64                                                                                                             1/1
  安装    : MySQL-server-5.6.47-1.el7.x86_64                                                                                                             1/1
警告:user mysql does not exist - using root
警告:group mysql does not exist - using root
警告:user mysql does not exist - using root
警告:group mysql does not exist - using root

  运行脚本: MySQL-server-5.6.47-1.el7.x86_64                                                                                                             1/1
user2024-08-23 13:27:39 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2024-08-23 13:27:39 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2024-08-23 13:27:39 0 [Note] /usr/sbin/mysqld (mysqld 5.6.47) starting as process 19903 ...
2024-08-23 13:27:39 19903 [Note] InnoDB: Using atomics to ref count buffer pool pages
2024-08-23 13:27:39 19903 [Note] InnoDB: The InnoDB memory heap is disabled
2024-08-23 13:27:39 19903 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-08-23 13:27:39 19903 [Note] InnoDB: Memory barrier is not used
2024-08-23 13:27:39 19903 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-08-23 13:27:39 19903 [Note] InnoDB: Using Linux native AIO
2024-08-23 13:27:39 19903 [Note] InnoDB: Using CPU crc32 instructions
2024-08-23 13:27:39 19903 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2024-08-23 13:27:39 19903 [Note] InnoDB: Completed initialization of buffer pool
2024-08-23 13:27:39 19903 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2024-08-23 13:27:39 19903 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2024-08-23 13:27:39 19903 [Note] InnoDB: Database physically writes the file full: wait...
2024-08-23 13:27:40 19903 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2024-08-23 13:27:40 19903 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2024-08-23 13:27:41 19903 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2024-08-23 13:27:41 19903 [Warning] InnoDB: New log files created, LSN=45781
2024-08-23 13:27:41 19903 [Note] InnoDB: Doublewrite buffer not found: creating new
2024-08-23 13:27:41 19903 [Note] InnoDB: Doublewrite buffer created
2024-08-23 13:27:41 19903 [Note] InnoDB: 128 rollback segment(s) are active.
2024-08-23 13:27:41 19903 [Warning] InnoDB: Creating foreign key constraint system tables.
2024-08-23 13:27:41 19903 [Note] InnoDB: Foreign key constraint system tables created
2024-08-23 13:27:41 19903 [Note] InnoDB: Creating tablespace and datafile system tables.
2024-08-23 13:27:41 19903 [Note] InnoDB: Tablespace and datafile system tables created.
2024-08-23 13:27:41 19903 [Note] InnoDB: Waiting for purge to start
2024-08-23 13:27:41 19903 [Note] InnoDB: 5.6.47 started; log sequence number 0
2024-08-23 13:27:41 19903 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2024-08-23 13:27:41 19903 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2024-08-23 13:27:41 19903 [Note] Binlog end
2024-08-23 13:27:41 19903 [Note] InnoDB: FTS optimize thread exiting.
2024-08-23 13:27:41 19903 [Note] InnoDB: Starting shutdown...
2024-08-23 13:27:43 19903 [Note] InnoDB: Shutdown completed; log sequence number 1625977
A random root password has been set. You will find it in '/root/.mysql_secret'.


2024-08-23 13:27:43 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2024-08-23 13:27:43 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2024-08-23 13:27:43 0 [Note] /usr/sbin/mysqld (mysqld 5.6.47) starting as process 19949 ...
2024-08-23 13:27:43 19949 [Note] InnoDB: Using atomics to ref count buffer pool pages
2024-08-23 13:27:43 19949 [Note] InnoDB: The InnoDB memory heap is disabled
2024-08-23 13:27:43 19949 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-08-23 13:27:43 19949 [Note] InnoDB: Memory barrier is not used
2024-08-23 13:27:43 19949 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-08-23 13:27:43 19949 [Note] InnoDB: Using Linux native AIO
2024-08-23 13:27:43 19949 [Note] InnoDB: Using CPU crc32 instructions
2024-08-23 13:27:43 19949 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2024-08-23 13:27:43 19949 [Note] InnoDB: Completed initialization of buffer pool
2024-08-23 13:27:43 19949 [Note] InnoDB: Highest supported file format is Barracuda.
2024-08-23 13:27:43 19949 [Note] InnoDB: 128 rollback segment(s) are active.
2024-08-23 13:27:43 19949 [Note] InnoDB: Waiting for purge to start
2024-08-23 13:27:43 19949 [Note] InnoDB: 5.6.47 started; log sequence number 1625977
2024-08-23 13:27:43 19949 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2024-08-23 13:27:43 19949 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2024-08-23 13:27:43 19949 [Note] Binlog end
2024-08-23 13:27:43 19949 [Note] InnoDB: FTS optimize thread exiting.
2024-08-23 13:27:43 19949 [Note] InnoDB: Starting shutdown...
2024-08-23 13:27:45 19949 [Note] InnoDB: Shutdown completed; log sequence number 1625987
...
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings


  验证    : MySQL-server-5.6.47-1.el7.x86_64                                                                                                             1/1

已安装:
  MySQL-server-5.6.47-1.el7.x86_64

完毕!

5.查看临时密码并使用该密码登录

[root@localhost localrepo]# cat /root/.mysql_secret
# The random password set for the root user at Fri Aug 23 13:27:41 2024 (local time): DY3Hus8E7ntGHzPY

[root@localhost localrepo]# mysql -uroot -p"DY3Hus8E7ntGHzPY"
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 2
Server version: 5.6.47

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

注意: 临时密码不可久用,需要及时修改密码

[root@localhost localrepo]# mysqladmin -uroot -p"DY3Hus8E7ntGHzPY" password "123456"

6.使用新密码登录

[root@localhost localrepo]# mysql -uroot -p123456
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 9
Server version: 5.6.47 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye

注意: 上述方法却不能实现mysql -uroot -h IP地址 -p123456登录,提示没有权限

7.赋权

[root@localhost localrepo]# mysql -uroot -p123456
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 11
Server version: 5.6.47 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create user "root"@"%" identified by "123456";
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on *.* to "root"@"%";
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

8.登录时加上ip再试试

[root@localhost localrepo]# mysql -uroot -h192.168.137.102 -p123456
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 12
Server version: 5.6.47 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2069119.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

如何关闭谷歌浏览器后台运行

当谷歌浏览器不再需要时仍处于后台运行的状态,这不仅消耗宝贵的系统资源,还会影响到多任务的处理效率。本文将为大家详细介绍关闭谷歌浏览器后台还在运行的原因,并提供详细步骤帮助大家禁用后台运行。(本文由https://www.liulanqi…

【FESCO福利专区-注册安全分析报告-无验证方式导致安全隐患】

前言 由于网站注册入口容易被黑客攻击,存在如下安全问题: 1. 暴力破解密码,造成用户信息泄露 2. 短信盗刷的安全问题,影响业务及导致用户投诉 3. 带来经济损失,尤其是后付费客户,风险巨大,造…

无线液位变送器的特点优势

无线液位变送器集成了多种先进功能,广泛应用于消防水车、水厂、污水处理厂、城市供水、高楼水池、水井、水塔、地热井、矿井等领域的液位监测,具有以下几个显著特点: 4G远程通信能力:无线液位变送器通过内置的4G模块,能…

详细分析Ubuntu中的ufw基本知识

目录 前言1. 基本知识2. 基本使用 前言 由于命令行比较简单,此处主要以表格的形式呈现,还有实战中遇到的一个注意点 1. 基本知识 Ubuntu 中一种用户友好的防火墙配置工具,简化 iptables 的使用,适合那些不熟悉复杂防火墙配置的…

JAVA基础面试题总结(十四)——JVM(下)

类文件结构详解 什么是字节码? 在 Java 中,JVM 可以理解的代码就叫做字节码(即扩展名为 .class 的文件),它不面向任何特定的处理器,只面向虚拟机。Java 语言通过字节码的方式,在一定程度上解决…

第二十八节、场景互动的逻辑实现

一、实现接口 mono后面加上接口类,然后实现方法 onenable在场景或物体关闭再打开的激活状态使用 二、绑定按键 三、场景转换 卸载当前场景;加载另一个场景;提供玩家的所处位置 将玩家位置粘贴过来

【Hexo】使用cloudflare pages自动化部署hexo

本文首发于 ❄️慕雪的寒舍 本文将教您使用cloudflare pages来白嫖部署hexo博客。 1.注册cloudflare 这部分就省略了,用邮箱注册就可以了 cloudflare pages的免费版本功能如下: 并发构建数:1(如果有多个pages,同一…

搭建Windows环境下的Redis服务与TinyRDM客户端

Redis是一个开源的高性能键值对数据库,以其内存中数据存储和快速的读写能力而广受开发者欢迎。在Windows环境下搭建Redis服务并使用TinyRDM客户端,可以为开发和日常使用提供极大的便利。 安装Redis服务 1. 下载Redis安装包 首先,下载Redis…

conda install 报错:LibMambaUnsatisfiableError

出现这个错误 LibMambaUnsatisfiableError 通常是因为 Conda 无法在当前配置的通道中找到满足所有依赖项的软件包。 运行下面两个命令解决: conda config --add channels conda-forge conda install -c stanfordnlp stanza1.4.0 有些包可能不在默认的 Conda 通道中…

ECharts tooltip默认html样式,保留样式只对数值格式化

之前遇到过需要对数据进行百分比展示,echarts提供的默认样式还是挺好的所以想保留样式,但是设置了formatter默认样式就没了,所以写了formatter的html字符串模拟还原了一下默认样式,在此记录和分享。 适用场景:对数据进…

MySQL中 EXPLAIN 的使用介绍

Day08-11. MySQL-索引-结构_哔哩哔哩_bilibili 使用 EXPLAIN 在查询语句前加上 EXPLAIN 关键字: EXPLAIN SELECT * FROM orders WHERE customer_id 123 AND order_date > 2023-01-01; 执行上述 EXPLAIN 语句,查看输出结果。MySQL 会返回一个包含查…

Linux 可视化管理工具:Webmin

😀前言 在 Linux 系统的运维管理中,命令行界面(CLI)是主要的操作方式。然而,对于许多系统管理员或开发者来说,使用 CLI 进行管理和维护任务并不总是最直观或最方便的方式。为了简化操作并提高效率&#xff…

LLama3本地部署安装

这篇教程将指导你如何在本机上安装 LLama3 客户端和可视化对话界面,我们会分为三部分:安装 LLama3 客户端、部署大模型和设置模型文件路径。 一、LLama3客户端安装 去 Ollama 官网下载 Ollama 客户端 Download Ollama on macOS 选择合适的操作系统平台…

Unity 编辑器-监听创建控件,prefab创建或添加组件的自动处理⭐

拓展控件 需求解决方案方案 需求 比如我想在添加Text时,自动添加一个脚本,用于处理多语言。在添加图片时,自动去掉raycast的勾选以节约性能损耗 解决方案 方案 ObjectFactory.componentWasAdded 用于监听组件的添加事件 using TMPro; us…

《基于智能化填报的单病种质量监测系统》

📢 大家好,我是 【战神刘玉栋】,有10多年的研发经验,致力于前后端技术栈的知识沉淀和传播。 💗 🌻 CSDN入驻不久,希望大家多多支持,后续会继续提升文章质量,绝不滥竽充数…

Python在QtSide6(PyQt)上加载网页使用OpenCV进行图像处理

基本思路: 1.在Qt Designer中添加QWebEngineView,该组件可用于加载网页 2.在python中开启Timer事件,每10ms进行一次网页窗口截图(QWidget.grab) 3.将截图(QPixmap)转换为cv.mat,进行图像处理…

关于thinkPHP3.2中的rewrite不严谨问题会导致网站被注入以及nginx配置中的if多条件判断问题-阿里云阻止指host访问

一、关于thinkPHP3.2中的rewrite不严谨问题会导致网站被注入 thinkPHP3.2的rewrite问题,之前也没在意过,但是今天浏览了一下服务器的一套CMS的相关东西,因为这套CMS是使用thinkPHP3.2搭建的,在浏览代码时发现其目录架构与目前的流…

内网横向移动常用方法

横向移动 #横向移动含义 横向移动是以已经被攻陷的系统为跳板,通过收集跳板机的信息(文档,存储的凭证,ipc连接记录等等信息)来访问其他域内主机。#常见横向手段 1,通过相同的用户名密码批量ipc连接其他域内…

【C++二分查找 】1477. 找两个和为目标值且不重叠的子数组

本文涉及的基础知识点 C二分查找 C算法:滑动窗口总结 C算法:前缀和、前缀乘积、前缀异或的原理、源码及测试用例 包括课程视频 LeetCode1477. 找两个和为目标值且不重叠的子数组 给你一个整数数组 arr 和一个整数值 target 。 请你在 arr 中找 两个互…

C语言 | Leetcode C语言题解之第368题最大整除子集

题目: 题解: int cmp(int* a, int* b) {return *a - *b; }int* largestDivisibleSubset(int* nums, int numsSize, int* returnSize) {int len numsSize;qsort(nums, numsSize, sizeof(int), cmp);// 第 1 步:动态规划找出最大子集的个数、…