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

MySQL包安装 -- SUSE系列(SUSE资源库安装MySQL)

文章目录

      • 2.2.3 SUSE系列
        • 2.2.3.1 SUSE资源库安装MySQL
          • 2.2.3.1.1 MySQL 8.0
          • 2.2.3.1.2 MySQL 8.4

2.2.3 SUSE系列

2.2.3.1 SUSE资源库安装MySQL
2.2.3.1.1 MySQL 8.0

在"openSUSE"上安装MySQL:

opensuse15:~ # wget https://repo.mysql.com//mysql80-community-release-sl15-1.noarch.rpmopensuse15:~ # rpm --import https://mirrors.nju.edu.cn/mysql/RPM-GPG-KEY-mysql-2023opensuse15:~ # rpm -Uvh mysql80-community-release-sl15-1.noarch.rpm # 替换国内镜像源
sed -i.bak 's|http://repo.mysql.com|https://mirrors.nju.edu.cn/mysql|g' /etc/zypp/repos.d/mysql-community*.repoopensuse15:~ # zypper refreshopensuse15:~ # zypper search "mysql-community-server"
Loading repository data...
Reading installed packages...S | Name                         | Summary                                      | Type
--+------------------------------+----------------------------------------------+--------| mysql-community-server       | A very fast and reliable SQL database server | package| mysql-community-server-debug | The debug version of MySQL server            | packageopensuse15:~ # zypper info "mysql-community-server"
Loading repository data...
Reading installed packages...Information for package mysql-community-server:
-----------------------------------------------
Repository     : MySQL 8.0 Community Server
Name           : mysql-community-server
Version        : 8.0.43-1.sl15
Arch           : x86_64
Vendor         : Oracle and/or its affiliates
Installed Size : 401.4 MiB
Installed      : No
Status         : not installed
Source package : mysql-community-8.0.43-1.sl15.src
Upstream URL   : http://www.mysql.com/
Summary        : A very fast and reliable SQL database server
Description    : The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,and robust SQL (Structured Query Language) database server. MySQL Serveris intended for mission-critical, heavy-load production systems as wellas for embedding into mass-deployed software. MySQL is a trademark ofOracle and/or its affiliatesThe MySQL software has Dual Licensing, which means you can use the MySQLsoftware free of charge under the GNU General Public License(http://www.gnu.org/licenses/). You can also purchase commercial MySQLlicenses from Oracle and/or its affiliates if you do not wish to be bound by the terms ofthe GPL. See the chapter "Licensing and Support" in the manual forfurther info.The MySQL web site (http://www.mysql.com/) provides the latest news andinformation about the MySQL software.  Also please see the documentationand the manual for more information.This package includes the MySQL server binary as well as related utilitiesto run and administer a MySQL server.opensuse15:~ # zypper install -y mysql-community-serveropensuse15:~ # 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 14:52:18 CST; 34s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 13723 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 13787 (mysqld)Status: "Server is operational"Tasks: 38 (limit: 2250)CPU: 5.712sCGroup: /system.slice/mysql.service└─13787 /usr/sbin/mysqldOct 03 14:52:10 opensuse15 systemd[1]: Starting MySQL Server...
Oct 03 14:52:17 opensuse15 (mysqld)[13787]: mysql.service: Referenced but unset environment variable evaluates t>
Oct 03 14:52:18 opensuse15 systemd[1]: Started MySQL Server.# 获取MySQL初始密码
opensuse15:~ # grep 'temporary password' /var/log/mysql/mysqld.log
2025-10-03T06:52:13.198731Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: y;_44nus=q8U
# "y;_44nus=q8U"就是MySQL的初始密码# 修改mysql密码
opensuse15:~ # mysqladmin -uroot -p'y;_44nus=q8U' 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'y;_44nus=q8U' 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 safetyopensuse15:~ # 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.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:		9
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:			1 min 49 secThreads: 2  Questions: 8  Slow queries: 0  Opens: 130  Flush tables: 3  Open tables: 46  Queries per second avg: 0.073
--------------mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)mysql> exit
Bye
2.2.3.1.2 MySQL 8.4

在"openSUSE"上安装MySQL:

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

t62

图62 下载SUSE仓库包

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

t63

图63 下载SUSE仓库包

选择“MySQL SUSE Repository(MySQL SUSE资源库)”,如图64所示。

t64

图64 下载SUSE仓库包

然后根据系统版本下载相应的安装包,如图65所示。

t65

图65 下载SUSE仓库包

opensuse15:~ # wget https://dev.mysql.com/get/mysql84-community-release-sl15-1.noarch.rpmopensuse15:~ # rpm --import https://mirrors.nju.edu.cn/mysql/RPM-GPG-KEY-mysql-2023opensuse15:~ # rpm -Uvh mysql84-community-release-sl15-1.noarch.rpm# 替换国内镜像源
sed -i.bak 's|http://repo.mysql.com|https://mirrors.nju.edu.cn/mysql|g' /etc/zypp/repos.d/mysql-community*.repoopensuse15:~ # zypper update -y mysql84-community-releaseopensuse15:~ # zypper refreshopensuse15:~ # zypper search "mysql-community-server"
Loading repository data...
Reading installed packages...S | Name                         | Summary                                      | Type
--+------------------------------+----------------------------------------------+--------| mysql-community-server       | A very fast and reliable SQL database server | package| mysql-community-server-debug | The debug version of MySQL server            | packageopensuse15:~ # zypper info mysql-community-server
Loading repository data...
Reading installed packages...Information for package mysql-community-server:
-----------------------------------------------
Repository     : MySQL 8.4 LTS Community Server
Name           : mysql-community-server
Version        : 8.4.6-1.sl15
Arch           : x86_64
Vendor         : Oracle and/or its affiliates
Installed Size : 380.0 MiB
Installed      : No
Status         : not installed
Source package : mysql-community-8.4.6-1.sl15.src
Upstream URL   : http://www.mysql.com/
Summary        : A very fast and reliable SQL database server
Description    : The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,and robust SQL (Structured Query Language) database server. MySQL Serveris intended for mission-critical, heavy-load production systems as wellas for embedding into mass-deployed software. MySQL is a trademark ofOracle and/or its affiliatesThe MySQL software has Dual Licensing, which means you can use the MySQLsoftware free of charge under the GNU General Public License(http://www.gnu.org/licenses/). You can also purchase commercial MySQLlicenses from Oracle and/or its affiliates if you do not wish to be bound by the terms ofthe GPL. See the chapter "Licensing and Support" in the manual forfurther info.The MySQL web site (http://www.mysql.com/) provides the latest news andinformation about the MySQL software.  Also please see the documentationand the manual for more information.This package includes the MySQL server binary as well as related utilitiesto run and administer a MySQL server.opensuse15:~ # zypper install -y mysql-community-serveropensuse15:~ # 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:08:08 CST; 29s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 13988 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 14050 (mysqld)Status: "Server is operational"Tasks: 35 (limit: 2250)CPU: 4.965sCGroup: /system.slice/mysql.service└─14050 /usr/sbin/mysqldOct 03 16:08:01 opensuse15 systemd[1]: Starting MySQL Server...
Oct 03 16:08:06 opensuse15 (mysqld)[14050]: mysql.service: Referenced but unset environment variable evaluates t>
Oct 03 16:08:08 opensuse15 systemd[1]: Started MySQL Server.# 获取MySQL初始密码
opensuse15:~ # grep 'temporary password' /var/log/mysql/mysqld.log
2025-10-03T08:08:04.005002Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: a/i1hpY;b8s#
# "a/i1hpY;b8s#"就是MySQL的初始密码# 修改mysql密码
opensuse15:~ #  mysqladmin -uroot -p'a/i1hpY;b8s#' 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'a/i1hpY;b8s#' 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 safetyopensuse15:~ # 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 35 secThreads: 2  Questions: 9  Slow queries: 0  Opens: 130  Flush tables: 3  Open tables: 46  Queries per second avg: 0.094
--------------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/458815.html

相关文章:

  • 从零开始的C语言学习014 指针5
  • photoshop做图网站长春建设集团股份有限公司网站
  • 都江堰旅游门户网站电子商务网站的开发语言
  • 卡片式设计的网站旅游网站建设系统
  • 做铁合金用哪个外贸网站好烟台网站建设的方法有哪些
  • 网站建设需要哪些企业资料网络营销有哪些策略
  • 网站开发的调研内容今天的新闻联播直播在线观看
  • 做网站属于什么备案成都网站建设十强企业
  • 网站统计怎么做域名的申请注册
  • 做网站专用素材wordpress里文章图片无法显示
  • 基于51单片机的室内烟雾温度与人体监测报警系统设计
  • 青岛网站建设培训学校wordpress手机字体变大6
  • 哈尔滨高端品牌网站建设建筑模板质量标准
  • 做订单管理网站用什么软件郑州网站制作方案
  • 百度网站推广申请Wordpress ajax 相册
  • 苏州建设网站的公司做网站分期付款比例
  • 购物网站页面桂林网站seo
  • 义乌网站建设推广网站建设方案流程
  • 企业网站的建设目的包含什么wordpress 获取页面
  • 做网站商机网络设计的安全性原则主要是指
  • 电商网站设计趋势千库网ppt
  • 网站设计可以用性原则怎么做义工网站
  • 山东省城乡和住房建设厅网站wordpress二级目录创建
  • intellij idea做网站wordpress文章顶置
  • 网站营销推广有哪些阿里巴巴网站怎样做的漂亮
  • 苏州专业网站建设公司wordpress新增站点
  • 网站四网合一品牌设计工作内容
  • 网站开发公司的销售方式厦门网站建设 孚珀科技
  • 电子商务网页设计与网站建设论文婚庆设计效果图
  • 网站欢迎页怎么做网站建设工作思路