惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
U
Unit 42
W
WeLiveSecurity
博客园 - Franky
Recent Announcements
Recent Announcements
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
月光博客
月光博客
The Cloudflare Blog
Spread Privacy
Spread Privacy
腾讯CDC
P
Privacy International News Feed
N
News and Events Feed by Topic
AWS News Blog
AWS News Blog
NISL@THU
NISL@THU
T
Troy Hunt's Blog
小众软件
小众软件
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Microsoft Security Blog
Microsoft Security Blog
L
Lohrmann on Cybersecurity
Webroot Blog
Webroot Blog
Y
Y Combinator Blog
量子位
P
Palo Alto Networks Blog
N
News and Events Feed by Topic
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
IT之家
IT之家
T
Threat Research - Cisco Blogs
Cloudbric
Cloudbric
云风的 BLOG
云风的 BLOG
C
Check Point Blog
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
G
Google Developers Blog
S
Secure Thoughts

郭大侠的博客

Vite 配置 Element Plus 自动按需导入 Vite 配置 Element Plus 图标自动按需导入 Windows WSL 安装 Debian Waline安全配置评论邮箱通知 使用 fnm 实现 Nodejs 版本自动切换(Windows版) 消失的他... 拔了一颗智齿 Vue Element 封装通用弹框的方法 茶叶蛋的救赎 鲜为人知的城镇杀猪盘 繁忙的六月 神奇的重庆北站 什么 TM 是 99 新 盘点那些让人爆笑的中式英语翻译 杨天才传 使用 Algolia DocSearch 实现站内全文检索 清明节回武汉的火车票真难抢 Git 日常使用指南 Git 安装和配置指南 Linux 系统使用 fnm 安装 Nodejs 任意版本 如何部署 Hexo 博客到 Linux 服务器 春节前北京到武汉国道长途自驾经历
银河麒麟V10离线安装 MySQL 8.0
郭大侠 · 2026-07-01 · via 郭大侠的博客

本篇文章详细讲解如何在银河麒麟 V10 (Kylin V10)系统中离线安装 MySQL 8.0 数据库。

本文适用于银河麒麟服务器操作系统V10 aarch64 版。

MySQL 安装包下载地址:

百度网盘:mysql_8.0_arm64.zip

下载以后,把压缩包上传到服务器并解压。

按顺序安装如下六个 rpm 包:

1
2
3
4
5
6
7
rpm -ivh mysql-community-common-8.0.46-1.el8.aarch64.rpm
rpm -ivh mysql-community-client-plugins-8.0.46-1.el8.aarch64.rpm
rpm -ivh mysql-community-libs-8.0.46-1.el8.aarch64.rpm
rpm -ivh mysql-community-client-8.0.46-1.el8.aarch64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.46-1.el8.aarch64.rpm
rpm -ivh mysql-community-server-8.0.46-1.el8.aarch64.rpm

1
2
3
4
5
6
7
8
9

systemctl start mysqld


systemctl enable mysqld


systemctl status mysqld

/var/log/mysqld.log 日志文件中找到 mysql 临时密码,类似如下的一行日志:

1
A temporary password is generated for root@localhost: O*!srpLCo0We

使用如下命令:

1
cat /var/log/mysqld.log

从日志中寻找临时密码:

1
2
3
4
5
6
7
8
9
10
11
2026-07-01T08:54:34.077096Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.46) initializing of server in progress as process 263190
2026-07-01T08:54:34.138902Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-07-01T08:54:36.726802Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-07-01T08:54:42.794517Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: O*!srpLCo0We
2026-07-01T08:54:54.622793Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.46) starting as process 263241
2026-07-01T08:54:54.637145Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-07-01T08:54:55.356227Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-07-01T08:54:56.006222Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2026-07-01T08:54:56.006390Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2026-07-01T08:54:56.059134Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2026-07-01T08:54:56.059482Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.46' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.

使用临时密码登录 MySQL:

1
mysql -uroot -p

输完以上命令,按回车以后,粘贴密码,再按回车,就登录 MySQL 了。

登录 MySQL 以后执行 SQL 修改 root 密码:

1
2
3
4
5
6
7
8
9
10
11

ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abcd@1234';


SET GLOBAL validate_password.policy = LOW;

SET GLOBAL validate_password.length = 6;


ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

停止 MySQL:

1
systemctl stop mysqld

打开 MySQL 配置文件:

1
vim /etc/my.cnf

在原有 my.cnf 的 [mysqld] 下面接着粘贴如下几行配置:

1
2
3
4
5
6
[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
default-authentication-plugin=mysql_native_password
default-time-zone='+8:00'

在 my.cnf 的最末尾追加如下几行配置(可选):

1
2
3
[client]
default-character-set=utf8mb4

保存退出。启动 MySQL:

1
systemctl start mysqld

登录MySQL,使用以下几个SQL语句查看配置是否正确:

1
2
3
4
5
6
7
8
SHOW VARIABLES LIKE '%character%';

SHOW VARIABLES LIKE '%collation%';

SHOW VARIABLES LIKE 'default_authentication_plugin';

SELECT user,host,plugin FROM mysql.user WHERE user='root';

主要验证打印的配置项和下面列出的配置项是否一致。

1
2
3
4
5
6
7
8
9
mysql> SHOW VARIABLES LIKE '%character%';
+-------------------------------------------------+--------------------------------+
| Variable_name | Value |
+-------------------------------------------------+--------------------------------+
| character_set_client | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
+-------------------------------------------------+--------------------------------+
1
2
3
4
5
6
7
mysql> SHOW VARIABLES LIKE '%collation%';
+-------------------------------+--------------------+
| Variable_name | Value |
+-------------------------------+--------------------+
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+-------------------------------+--------------------+
1
2
3
4
5
6
mysql> SHOW VARIABLES LIKE 'default_authentication_plugin';
+-------------------------------+-----------------------+
| Variable_name | Value |
+-------------------------------+-----------------------+
| default_authentication_plugin | mysql_native_password |
+-------------------------------+-----------------------+
1
2
3
4
5
6
mysql> SELECT user,host,plugin FROM mysql.user WHERE user='root';
+------+-----------+-----------------------+
| user | host | plugin |
+------+-----------+-----------------------+
| root | localhost | mysql_native_password |
+------+-----------+-----------------------+

到此,MySQL 8.0 的安装和配置就搞好了。

文章标题:银河麒麟V10离线安装 MySQL 8.0