使用Redhat操作系统下载MySQL

这篇具有很好参考价值的文章主要介绍了使用Redhat操作系统下载MySQL。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、本地下载安装

方法一

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

redhat操作系统 下载,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

redhat操作系统 下载,mysql,数据库

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

[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

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

redhat操作系统 下载,mysql,数据库

③选择环境变量

选中Path之后点击编辑

redhat操作系统 下载,mysql,数据库

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

redhat操作系统 下载,mysql,数据库

⑤测试

redhat操作系统 下载,mysql,数据库文章来源地址https://www.toymoban.com/news/detail-815103.html

到了这里,关于使用Redhat操作系统下载MySQL的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 《操作系统导论》吐血万字整理 - 附下载地址及思维导图

    我看的是这本,豆瓣9.4,很经典的教材书, 在文章末尾我附上了网盘链接 这篇博客算是一个完整的读书笔记,我大概读了20天看完的,电子版做笔记很方便,推荐一波,很多课上没有讲到的知识在这本书里都详细阐释了 全书的思维导图 一个正在运行的程序会做:取址执行。

    2023年04月19日
    浏览(32)
  • 基于Linux操作系统中的MySQL数据库操作(三十)

    MySQL数据库安装 目录 一、概述 (一)什么是数据库 (二)数据库能干什么     1、企业应用     2、金融行业     3、电子商务     4、社交媒体     5、物联网 (三)为什么要用数据库,优势、特性?     1、可靠性和稳定性     2、数据管理能力     3、数据共享和集成  

    2024年02月15日
    浏览(47)
  • 银河麒麟高级服务器操作系统V10下载安装及安装docker

    银河麒麟操作系统v10是中国电子研发的操作系统,该系统充分适应5G时代需求,打通手机、平板电脑、PC等,实现多端融合。 x86/兆芯/海光 Kylin-Server-10-SP2-x86-Release-Build09-20210524.iso 链接:https://pan.baidu.com/s/16sa8sumcJzXI95ip9gwptg 提取码:wxyu arm64/飞腾/鲲鹏 Kylin-Server-10-SP2-aarch64-Rel

    2024年01月16日
    浏览(61)
  • Linux操作系统彻底删除MySQL——详细步骤

    注意 :在安装另一个MySQL版本之前一定要把之前MySQL版本给卸载干净。 详细步骤如下: 1、检查云服务器是否已经安装了MySQL: 如下所示: 2、查看MySQL服务是否开启: 如开启则须关闭,关闭MySQL服务: 3、查找含有MySQL的目录: 如下所示: 4、删除含有MySQL的目录,依次删除目

    2024年02月01日
    浏览(67)
  • 【Nginx】centos和Ubuntu操作系统下载Nginx配置文件并启动Nginx服务详解

    目录 🌷 安装Nginx环境 🍀 centos操作系统 🍀 ubuntu操作系统 以下是在linux系统中安装Nginx的步骤: 查看服务器属于哪个操作系统 安装 yum : 如果你确定你的系统应该支持 yum ,但它没有安装,你可以尝试安装它。使用以下命令: ①:更新系统软件包 centos: ②:安装EPEL存储库

    2024年04月26日
    浏览(26)
  • 大数据:HDFS的Shell操作,进程启动管理,文件系统操作命令,创建文件文件夹,下载上传,复制移动,删除,展示,追加内容

    2022找工作是学历、能力和运气的超强结合体,遇到寒冬,大厂不招人,可能很多算法学生都得去找开发,测开 测开的话,你就得学数据库,sql,oracle,尤其sql要学,当然,像很多金融企业、安全机构啥的,他们必须要用oracle数据库 这oracle比sql安全,强大多了,所以你需要学

    2024年02月07日
    浏览(46)
  • 银河麒麟V10操作系统(aarch64架构)部署mysql

    1.解压 2.安装必须软件(务必根据顺序) 3.修改配置文件 在末尾补一行: 4.初始化数据库 5.目录授权 6.启动mysql服务 7.编辑下环境变量 末尾加上一行: 8.查看临时密码 9.用临时密码登录 10.修改密码  navicat远程连接报错 1251 client does not support authentication protocol requested by server;c

    2024年02月09日
    浏览(53)
  • 银河麒麟v10操作系统之 mysql 5.7 手动安装

    官网下载地址:https://dev.mysql.com/downloads/mysql/ 打开 https://dev.mysql.com/downloads/mysql/,默认显示的是最新版MySQL8,需要我们点击查看其他版本。  或者也可以这样。 我图省事直接按上图操作了哈。  接下来看图操作  根据自己的系统位数去选择,Linux系统输入  getconf LONG_BIT 命令

    2024年02月09日
    浏览(40)
  • 【MYSQL数据库的增删改查操作-超市管理系统】

    MYSQL数据库的增删改查 创建数据库 选择数据库 删除数据库 创建数据表 删除数据表 插入数据 更新数据 查找数据 以超市管理系统为例,包含员工表,库存表,仓库表 数据库:db_supermarket 数据表:s_employee #员工表;s_stock #库存表;s_storehouse #仓库表 插入数据之后生成表如下:

    2024年02月09日
    浏览(36)
  • 银河麒麟高级服务器操作系统V10安装mysql数据库

    1.检查是否已经安装mysql 2.将查询出的包卸载掉 3.将/usr/lib64/libLLVM-7.so删除 4.检查删除结果 5.搜索残余文件 6.删除残余文件 7.验证删除 8.检查MySQL用户组以及用户是否存在,若没有则创建 9.上传安装包 将mysql-8.0.33-linux-glibc2.17-x86_64-minimal.tar安装包上传到银河麒麟系统虚拟机中

    2024年02月16日
    浏览(71)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包