当前位置: 首页 > news >正文

MySQL包安装 -- SUSE系列(离线RPM包安装MySQL)

文章目录

        • 2.2.3.2 离线RPM包安装MySQL
          • 2.2.3.2.1 MySQL 8.0
          • 2.2.3.2.2 MySQL 8.4

2.2.3.2 离线RPM包安装MySQL
2.2.3.2.1 MySQL 8.0

去“https://www.mysql.com/”网站下载,选择“DOWNLOADS”,如图66所示。

t66

图66 下载MySQL RPM包

选择“MySQL Community (GPL) Downloads”,如图67所示。

t67

图67 下载MySQL RPM包

选择“MySQL Community Server(MySQL社区服务器)”,如图68所示。

t68

图68 下载MySQL RPM包

在“openSUSE”上安装MySQL:

"Select Version(选择版本)"为:8.0.43,“Select Operating System(选择操作系统)”为:SUSE Linux Enterprise Server,然后选择”RPM Bundle“后面的”Download“,如图69所示。

t69

图69 下载MySQL RPM包

opensuse15:~ # wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.43-1.sl15.x86_64.rpm-bundle.taropensuse15:~ # tar xf mysql-8.0.43-1.sl15.x86_64.rpm-bundle.taropensuse15:~ # rpm --import https://mirrors.nju.edu.cn/mysql/RPM-GPG-KEY-mysql-2023

方法1:rpm命令安装,要按下面执行的顺序安装,否则会报错

opensuse15:~ # rpm -ivh mysql-community-client-plugins-8.0.43-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-common-8.0.43-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-libs-8.0.43-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-client-8.0.43-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-icu-data-files-8.0.43-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-server-8.0.43-1.sl15.x86_64.rpm

方法2:zypper命令安装,从”https://dev.mysql.com/doc/refman/8.4/en/linux-installation-rpm.html“网址看到安装文档

opensuse15:~ # zypper install -y mysql-community-{server,client,client-plugins,icu-data-files,common,libs}-8.0.43-1.sl15.x86_64.rpm

继续安装MySQL:

opensuse15:~ # systemctl enable --now mysqlopensuse15:~ # ls /var/lib/mysql
#ib_16384_0.dblwr  auto.cnf       ca.pem           ibdata1    mysql.sock          public_key.pem   undo_001
#ib_16384_1.dblwr  binlog.000001  client-cert.pem  ibtmp1     mysql.sock.lock     server-cert.pem  undo_002
#innodb_redo       binlog.index   client-key.pem   mysql      performance_schema  server-key.pem
#innodb_temp       ca-key.pem     ib_buffer_pool   mysql.ibd  private_key.pem     sysopensuse15:~ # mysql -V
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)opensuse15:~ # systemctl status mysql
● mysql.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: disabled)Active: active (running) since Fri 2025-10-03 15:15:20 CST; 29s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 13833 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 13897 (mysqld)Status: "Server is operational"Tasks: 38 (limit: 2250)CPU: 5.358sCGroup: /system.slice/mysql.service└─13897 /usr/sbin/mysqldOct 03 15:15:12 opensuse15 systemd[1]: Starting MySQL Server...
Oct 03 15:15:19 opensuse15 (mysqld)[13897]: mysql.service: Referenced but unset environment variable evaluates t>
Oct 03 15:15:20 opensuse15 systemd[1]: Started MySQL Server.# 获取MySQL初始密码
opensuse15:~ # grep password /var/log/mysql/mysqld.log
2025-10-03T07:15:15.023729Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: qlyCwXu%K7.Z
# "qlyCwXu%K7.Z"就是MySQL的初始密码# 修改mysql密码
opensuse15:~ # mysqladmin -uroot -p'qlyCwXu%K7.Z' password 123456
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'
# 上面报错提示密码太简单opensuse15:~ # mysqladmin -uroot -p'qlyCwXu%K7.Z' password Raymond@2025
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.opensuse15:~ # mysql -uroot -p'Raymond@2025'
mysql: [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 10
Server version: 8.0.43 MySQL Community Server - GPLCopyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)Connection id:		10
Current database:	
Current user:		root@localhost
SSL:			Not in use
Current pager:		less
Using outfile:		''
Using delimiter:	;
Server version:		8.0.43 MySQL Community Server - GPL
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8mb4
Conn.  characterset:	utf8mb4
UNIX socket:		/var/lib/mysql/mysql.sock
Binary data as:		Hexadecimal
Uptime:			3 min 10 secThreads: 2  Questions: 8  Slow queries: 0  Opens: 130  Flush tables: 3  Open tables: 46  Queries per second avg: 0.042
--------------mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)mysql> exit
Bye
2.2.3.2.2 MySQL 8.4

去“https://www.mysql.com/”网站下载,选择“DOWNLOADS”,如图70所示。

t70

图70 下载MySQL RPM包

选择“MySQL Community (GPL) Downloads”,如图71所示。

t71

图71 下载MySQL RPM包

选择“MySQL Community Server(MySQL社区服务器)”,如图72所示。

t72

图72 下载MySQL RPM包

在“openSUSE”上安装MySQL:

"Select Version(选择版本)"为:8.0.43,“Select Operating System(选择操作系统)”为:SUSE Linux Enterprise Server,然后选择”RPM Bundle“后面的”Download“,如图73所示。

t73

图73 下载MySQL RPM包

opensuse15:~ # wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-8.4.6-1.sl15.x86_64.rpm-bundle.taropensuse15:~ # tar xf mysql-8.4.6-1.sl15.x86_64.rpm-bundle.taropensuse15:~ # rpm --import https://mirrors.nju.edu.cn/mysql/RPM-GPG-KEY-mysql-2023

方法1:rpm命令安装,要按下面执行的顺序安装,否则会报错

opensuse15:~ # rpm -ivh mysql-community-client-plugins-8.4.6-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-common-8.4.6-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-libs-8.4.6-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-client-8.4.6-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-icu-data-files-8.4.6-1.sl15.x86_64.rpmopensuse15:~ # rpm -ivh mysql-community-server-8.4.6-1.sl15.x86_64.rpm

方法2:zypper命令安装,从”https://dev.mysql.com/doc/refman/8.4/en/linux-installation-rpm.html“网址看到安装文档

opensuse15:~ # zypper install -y mysql-community-{server,client,client-plugins,icu-data-files,common,libs}-8.0.43-1.sl15.x86_64.rpm

继续安装MySQL:

opensuse15:~ # systemctl enable --now mysqlopensuse15:~ # ls /var/lib/mysql
#ib_16384_0.dblwr  auto.cnf       ca.pem           ibdata1    mysql.sock             private_key.pem  sys
#ib_16384_1.dblwr  binlog.000001  client-cert.pem  ibtmp1     mysql.sock.lock        public_key.pem   undo_001
#innodb_redo       binlog.index   client-key.pem   mysql      mysql_upgrade_history  server-cert.pem  undo_002
#innodb_temp       ca-key.pem     ib_buffer_pool   mysql.ibd  performance_schema     server-key.pemopensuse15:~ # mysql -V
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)opensuse15:~ # systemctl status mysql
● mysql.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: disabled)Active: active (running) since Fri 2025-10-03 16:29:00 CST; 30s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 13709 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 13771 (mysqld)Status: "Server is operational"Tasks: 35 (limit: 2250)CPU: 4.747sCGroup: /system.slice/mysql.service└─13771 /usr/sbin/mysqldOct 03 16:28:53 opensuse15 systemd[1]: Starting MySQL Server...
Oct 03 16:28:59 opensuse15 (mysqld)[13771]: mysql.service: Referenced but unset environment variable evaluates t>
Oct 03 16:29:00 opensuse15 systemd[1]: Started MySQL Server.# 获取MySQL初始密码
opensuse15:~ # grep password /var/log/mysql/mysqld.log
2025-10-03T08:28:56.486012Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: w/#MU*%7LP9U
# "w/#MU*%7LP9U"就是MySQL的初始密码# 修改mysql密码
opensuse15:~ # mysqladmin -uroot -p'w/#MU*%7LP9U' password 123456
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'
# 上面报错提示密码太简单opensuse15:~ # mysqladmin -uroot -p'w/#MU*%7LP9U' password Raymond@2025
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.opensuse15:~ # mysql -uroot -p'Raymond@2025'
mysql: [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: 8.4.6 MySQL Community Server - GPLCopyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)Connection id:		9
Current database:	
Current user:		root@localhost
SSL:			Not in use
Current pager:		less
Using outfile:		''
Using delimiter:	;
Server version:		8.4.6 MySQL Community Server - GPL
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8mb4
Conn.  characterset:	utf8mb4
UNIX socket:		/var/lib/mysql/mysql.sock
Binary data as:		Hexadecimal
Uptime:			1 min 30 secThreads: 2  Questions: 9  Slow queries: 0  Opens: 130  Flush tables: 3  Open tables: 46  Queries per second avg: 0.100
--------------mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)mysql> exit
Bye
http://www.dtcms.com/a/458000.html

相关文章:

  • 老卡文迪许的“四论”密码
  • 个人可以建购物网站吗建站哪个网站好
  • 南京环力建设有限公司网站WordPress 经典博客
  • 网站模块化网站建设记什么科目
  • SSM电影售票管理系统n9y72(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
  • 网站展现形式免费企业注册
  • [工作流节点17] 数据校验与错误处理机制:为自动化流程建立安全阀门
  • ESP32-S3 入门第十天:图像识别基础与 NPU 应用
  • 视频重新照明新突破!北大中科大浙大等提出重照明方法Lumen:一句话让视频秒变电影级光影。
  • 亚马逊商标备案是否必须做网站新手做电商怎么起步
  • 邢台集团网站建设报价网站定制哪家正规
  • 57.Nginx重写,if,基于浏览器分离,防盗链
  • 【多线程】死锁
  • 自学阿里云认证,能救一个是一个!
  • 买域名做网站跳转网新科技集团有限公司
  • 关于网站维护的书籍商务网站规划建设与管理答案
  • 【C语言基础详细版】03. 函数详解:从概念到高级应用
  • 涿州做网站公司阿里云网站怎么备案域名
  • 网站制作设计机构贵阳企业网站建设
  • wordpress快速仿站教程建立一个网站需要哪些
  • Linux 进程分身术:fork() 函数的深度解析
  • 小程序建站公司app开发需要多少费用
  • 贪心算法详解:从入门到精通(C++实现)
  • 颜群JVM【04】助记符
  • 网站优化 推广重庆教育建设集团有限公司网站
  • Manjaro 系统下 PCManFM 挂载 NTFS 分区报错:从踩坑到彻底解决
  • 单片机使用串口(usart) , 封装( print )函数 .
  • 外贸网站建设和优化做网站要不要学ps
  • 福建省建设厅网站 企业三网一体网站建设
  • 湖南做网站大连凯杰建设有限公司网站