使用Redhat操作系统下载MySQL

一、本地下载安装

方法一

①在虚拟机火狐浏览器中搜索MySQL官网(选择第一个下载)

②下载完毕使用xshell远程连接解压及安装

[root@localhost ~]# cd /Downloads/
[root@localhost Downloads]# mkdir /mysql/
[root@localhost Downloads]# mv mysql-8.0.35-1.el9.x86_64.rpm-bundle.tar /mysql/
[root@localhost Downloads]# cd /mysql/
[root@localhost mysql]# tar xvf mv mysql-8.0.35-1.el9.x86_64.rpm-bundle.tar
[root@localhost mysql]# dnf localinstall mysql-community-server-8.0.35-1.el9.x86_64.rpm mysql-community-client-8.0.35-1.el9.x86_64.rpm mysql-community-common-8.0.35-1.el9.x86_64.rpm mysql-community-icu-data-files-8.0.35-1.el9.x86_64.rpm mysql-community-client-plugins-8.0.35-1.el9.x86_64.rpm mysql-community-libs-8.0.35-1.el9.x86_64.rpm
#重启服务
[root@localhost mysql]# systemctl start mysqld
#查看密码
[root@localhost mysql]# grep password /var/log/mysqld.log
2024-01-08T12:51:28.338783Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: qdug_%:&y2gU
#登录数据库
[root@localhost mysql]# mysql -uroot -p
Enter password:         #此处密码是生成的随机密码
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.35

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

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> show databases;        #查看数据库,测试是否成功
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.        #错误:必须修改密码才可以
mysql> alter user 'root'@'localhost' identified by '#OPENlab123';        #修改密码
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)
mysql> exit        #退出
Bye

方法二

[root@localhost ~]# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.35-
1.el9.x86_64.rpm-bundle.tar
[root@localhost ~]# mkdir /mysql/
[root@localhost mysql]# tar xvf mysql-8.0.35-1.el9.x86_64.rpm-bundle.tar
[root@localhost mysql]# dnf localinstall mysql-community-server-8.0.35-1.el9.x86_64.rpm mysql-community-client-8.0.35-1.el9.x86_64.rpm mysql-community-common-8.0.35-1.el9.x86_64.rpm mysql-community-icu-data-files-8.0.35-1.el9.x86_64.rpm mysql-community-client-plugins-8.0.35-1.el9.x86_64.rpm mysql-community-libs-8.0.35-1.el9.x86_64.rpm
#重启服务
[root@localhost mysql]# systemctl start mysqld
#查看密码
[root@localhost mysql]# grep password /var/log/mysqld.log
2024-01-08T12:51:28.338783Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: qdug_%:&y2gU
#登录数据库
[root@localhost mysql]# mysql -uroot -p
Enter password:         #此处密码是生成的随机密码
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.35

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

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> show databases;        #查看数据库,测试是否成功
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.        #错误:必须修改密码才可以
mysql> alter user 'root'@'localhost' identified by '#OPENlab123';        #修改密码
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)
mysql> exit        #退出
Bye

二、本地仓库下载安装(本地安装的MySQL默认是没有密码的

①配置本地仓库

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim /etc/yum.repos.d/wangluo.repo
[wangluo-app]
name=wanluo-app
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/AppStream/x86_64/os/
gpgcheck=0
[wangluo-base]
name=wangluo-base
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/os/
gpgcheck=0

②下载

[root@localhost yum.repos.d]# mount /dev/sr0 /mnt        #失败可能是没有挂载的原因
#下载(但它的版本不是最新的)
[root@localhost yum.repos.d]# dnf install mysql-server

③测试

[root@localhost yum.repos.d]# systemctl start mysqld
[root@localhost yum.repos.d]# mysql -uroot -p        #不需要密码直接回车
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.32 Source distribution

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye

三、网络仓库下载安装

①找仓库文件(双击进去选择第一个下载)

复制下载的链接:https://repo.mysql.com//mysql80-community-release-el9-5.noarch.rpm

②查看本地仓库并下载安装

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim /rpm.repo
[baseos]
name=baseos
baseurl=/mnt/BaseOS
gpgcheck=0
[appstream]
name=appstream
baseurl=/mnt/AppStream
gpgcheck=0
[root@localhost yum.repos.d]# rpm -i https://repo.mysql.com//mysql80-community-release-el9-5.noarch.rpm
警告:/var/tmp/rpm-tmp.v6x1sA: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
[root@localhost yum.repos.d]# ll
总用量 16
-rw-r--r--. 1 root root 2129 10月 24 21:13 mysql-community-debuginfo.repo
-rw-r--r--. 1 root root 1910 10月 24 21:13 mysql-community.repo
-rw-r--r--. 1 root root 1989 10月 24 21:13 mysql-community-source.repo
-rw-r--r--. 1 root root  358  1月  8 21:28 redhat.repo
[root@localhost yum.repos.d]# dnf install mysql-server -y

③测试

[root@localhost yum.repos.d]# systemctl start mysqld
[root@localhost yum.repos.d]# systemctl start mysqld
[root@localhost yum.repos.d]#  grep password /var/log/mysqld.log
2024-01-08T13:35:54.233551Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: eojFkyWh%6Cw
[root@localhost yum.repos.d]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.35

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

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> alter user 'root'@'localhost' identified by '#OPENlab123';
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> exit
Bye

四、补充(在命令行界面执行MySQL语句)

①必须要修改环境变量才可使用

环境变量路径为:C:\Program Files\MySQL\MySQL Server 8.0\bin

②在此电脑右键点击属性,打开高级系统设置

③选择环境变量

选中Path之后点击编辑

④点击新建将刚才复制的路径添加进去

⑤测试

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

北斗短报文技术在灾区通讯救援中的应用与价值

北斗短报文技术在灾区通讯救援中的应用与价值 随着全球化的进程和科技的快速发展,人类社会在取得巨大经济成果的同时,也面临了许多自然灾害的挑战。地震、洪水、台风等天灾频繁发生,严重威胁着人们的生命财产安全。灾害发生时,及…

视频AI智剪方法:快速批量处理视频,批量剪辑视频的操作

随着科技的飞速发展,视频内容已是获取信息和娱乐的主要方式之一。对于视频创作者和内容生产者来说,如何快速、高效地处理和剪辑大量视频已成为一项重要的需求。现在借助AI技术的不断发展,可以更加智能、高效的处理视频。下面来看云炫AI智剪如…

深度学习:图神经网络——在推荐系统中的应用

PinSage是工业界应用图神经网络完成推荐任务的第一个成功案例,其从用户数据中构造图(graph)的方法和应对大规模图而采取的实现技巧都值得我们学习。PinSage被应用在图片推荐类Pinterest上。在Pinterest中,每个用户可以创建并命名图…

【angular教程240105】02绑定属性 绑定数据、条件判断、加载图片、【ngClass】 【ngStyle】、Angular管道

【angular】02绑定属性 绑定数据、条件判断、加载图片、【ngClass】 【ngStyle】、Angular管道 0 一些基础的概念 标记为可注入的服务 在Angular中,一个服务是一个通常提供特定功能的类,比如获取数据、日志记录或者业务逻辑等。标记为可注入的服务意味着…

推荐 5 款强大好用的日志管理工具

日志管理是现代 IT 环境中不可或缺的一部分,它有助于监视和维护应用程序、系统和网络的正常运行,帮助诊断问题,追踪事件以及确保安全性。 在日志管理领域,有不少功能强大的工具,本文将为你介绍这些工具。 1、Graylog …

Vue2:通过ref获取DOM元素

一、场景描述 我们在页面的开发过程中&#xff0c;经常需要操作dom元素&#xff0c;来实现我们需要的效果。 以往js中&#xff0c;我们是通过给dom添加id&#xff0c;然后&#xff0c;通过js代码document来获取这个dom 简写代码案例&#xff1a; <h2 id"test"&…

Mysql之子查询、连接查询(内外)以及分页查询

目录 一.案例&#xff08;接上篇博客&#xff09; 09&#xff09;查询学过「张三」老师授课的同学的信息 10&#xff09;查询没有学全所有课程的同学的信息 11&#xff09;查询没学过"张三"老师讲授的任一门课程的学生姓名 12&#xff09;查询两门及其以上不及格课程…

【数据结构】栈的基本知识详解

栈的基本概念与基本操作 导言一、栈的基本概念1.1 栈的定义1.2 栈的重要术语1.3 栈的数学性质 二、栈的基本操作结语 导言 大家好&#xff0c;很高兴又和大家见面了&#xff01;&#xff01;&#xff01; 今天开始&#xff0c;咱们将正式进入【数据结构】第三章的内容介绍。在…

第二证券:主力为什么要砸盘?

砸盘就是在股票的某个阶段有许多卖出单&#xff0c;这些许多的卖出单不断的成交使股票价格出现快速下跌。一般是受到主力资金洗盘或者出货所影响形成的。 1、洗盘 个股通过长时间上涨之后&#xff0c;盘中的散户较多&#xff0c;主力为了洗掉盘中的散户&#xff0c;在低位吸筹…

nodejs+vue+ElementUi音乐分享社交网站77l8j

本文介绍的系统主要分为两个部分&#xff1a;一是前台界面&#xff1a;用户通过注册登录可以实现音乐播放、新闻浏览、留言评论等功能&#xff1b;另一个是后台界面&#xff1a;音乐网站管理员对用户信息进行管理&#xff0c;上传更新音乐资源&#xff0c;发布最新音乐资讯等功…

SpringBoot 中 @Transactional 注解的使用

一、基本介绍 事务管理是应用系统开发中必不可少的一部分。Spring 为事务管理提供了丰富的功能支持。Spring 事务管理分为编程式和声明式的两种方式。本篇只说明声明式注解。 1、在 spring 项目中, Transactional 注解默认会回滚运行时异常及其子类&#xff0c;其它范…

目标检测再升级!YOLOv8模型训练和部署

YOLOv8 是 Ultralytics 开发的 YOLO&#xff08;You Only Look Once&#xff09;物体检测和图像分割模型的最新版本。YOLOv8是一种尖端的、最先进的SOTA模型&#xff0c;它建立在先前YOLO成功基础上&#xff0c;并引入了新功能和改进&#xff0c;以进一步提升性能和灵活性。它可…

揭秘阿里自研搜索引擎 Havenask 在线检索服务

作者&#xff1a;谷深 Havenask 是阿里巴巴智能引擎事业部自研的开源高性能搜索引擎&#xff0c;深度支持了包括淘宝、天猫、菜鸟、高德、饿了么在内几乎整个阿里的搜索业务。本文针对性介绍了 Havenask 的在线服务&#xff0c;它具备高可用、高时效、低成本的优势&#xff0c;…

【软考中级-软件设计师】day4:数据结构-线性表、单链表、栈和队列、串

大纲 线性结构 顺序存储和链式存储区别 单链表的插入和删除 真题 栈和队列 真题 串

微创新与稳定性的权衡

之前做过一个项目&#xff0c;业务最高峰CPU使用率也才50%&#xff0c;是一个IO密集型的应用。里面涉及一些业务编排&#xff0c;所以为了提高CPU使用率&#xff0c;我有两个方案&#xff1a;一个是简单的梳理将任务可并行的采用并行流、额外线程池等方式做并行&#xff1b;另外…

2019年认证杯SPSSPRO杯数学建模A题(第一阶段)好风凭借力,送我上青云全过程文档及程序

2019年认证杯SPSSPRO杯数学建模 纸飞机在飞行状态下的运动模型 A题 好风凭借力&#xff0c;送我上青云 原题再现&#xff1a; 纸飞机有许多种折法。世界上有若干具有一定影响力的纸飞机比赛&#xff0c;通常的参赛规定是使用一张特定规格的纸&#xff0c;例如 A4 大小的纸张…

计操进程同步(信号量pv灵魂三问法狂练版)

文章目录 解题秘诀-灵魂三问法一 同步问题1.1 围棋问题1.2 数据采集问题1.3 三进程文件打印问题1.4 司机售票员问题 二 同步互斥问题2.1 果盘问题 三 同步资源管控问题3.1 兔子问题3.2 数据写入和读取问题3.3 图书馆问题3.4 超市问题3.4.1 解法一3.4.2 解法二 解题秘诀-灵魂三问…

(Matlab)基于CNN-Bi_LSTM的多维时序回归预测(卷积神经网络-双向长短期记忆网络)

目录 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 亮点与优势&#xff1a; 二、实际运行效果&#xff1a; 三、部分代码展示&#xff1a; 四、完整代码数据下载&#xff1a; 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 本代码基于Matlab平…

【idea】idea 开发快捷键

在Java开发中&#xff0c;有一些常用的快捷键和工具&#xff0c;可以提高开发效率。以下是一些常见的Java开发常用到的功能和快捷键&#xff1a; IDE快捷键&#xff1a; 代码大小写切换&#xff1a; ctrlshiftu 格式化代码&#xff1a;Ctrl Alt L&#xff0c;会让代码更整…

程序员必知!备忘录模式的实战应用与案例分析

备忘录模式允许在不破坏封装性下捕获并在外部保存对象状态&#xff0c;支持状态恢复&#xff0c;常用于撤销、历史记录等功能。例如在线文档编辑器的撤销操作&#xff0c;编辑器作为原发起人记录状态并提供保存与恢复方法&#xff0c;历史记录或撤销为管理者&#xff0c;保存备…
最新文章