第一篇写道 CentOS 7.9 Linux 环境 Polardb-X 数据库 单机版 rpm 包 安装教程
第二篇文章是 国产银河麒麟V10操作系统 Linux 环境 国产银河麒麟V10操作系统安装 Polardb-X 数据库 单机版 rpm 包 教程
本篇文章是基于 华为 欧拉 openEuler 20.03 操作系统
基本步骤和上两篇基本相似,以下是详细过程
[root@localhost ~]# cat /etc/openEuler-release
openEuler release 20.03 (LTS)
[root@localhost ~]#
[root@localhost ~]# free -h
total used free shared buff/cache available
Mem: 7.3Gi 266Mi 6.8Gi 0.0Ki 195Mi 6.6Gi
Swap: 4.0Gi 0B 4.0Gi
[root@localhost ~]#
[root@localhost ~]# ll
total 4.0K
-rw-------. 1 root root 1.1K Nov 17 11:49 anaconda-ks.cfg
[root@localhost ~]#
[root@localhost ~]# ll
total 644M
-rw-------. 1 root root 1.1K Nov 17 11:49 anaconda-ks.cfg
-rw-------. 1 root root 644M Jan 8 16:19 t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64.rpm
[root@localhost ~]#
[root@localhost ~]# yum repolist
repo id repo name
OS openEuler-20.03LTS-OS
update openEuler-20.03LTS-Update
[root@localhost ~]#
[root@localhost ~]# yum install ./t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64.rpm
Last metadata expiration check: 0:00:42 ago on Thu 08 Jan 2026 04:19:49 PM CST.
Dependencies resolved.
===============================================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================================
Installing:
t-polardbx-engine x86_64 8.4.19-20250825_17558853.el7 @commandline 643 M
Transaction Summary
===============================================================================================================================================
Install 1 Package
Total size: 643 M
Installed size: 2.8 G
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Installing : t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Running scriptlet: t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Copying /u01/xcluster80_20250825_current to /u01/xcluster80
Copying /u01/xcluster80_20250825_current to /u01/xcluster80_20250825
Verifying : t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Installed:
t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64
Complete!
[root@localhost ~]# ll /opt/polardbx_engine/
total 732K
drwxr-xr-x. 2 root root 4.0K Jan 8 16:21 bin
drwxr-xr-x. 2 root root 4.0K Jan 8 16:21 docs
drwxr-xr-x. 3 root root 4.0K Jan 8 16:21 include
drwxr-xr-x. 6 root root 4.0K Jan 8 16:21 lib
-rwxr-xr-x. 1 root root 277K Jan 8 16:21 LICENSE
-rwxr-xr-x. 1 root root 119K Jan 8 16:21 LICENSE.router
-rwxr-xr-x. 1 root root 277K Jan 8 16:21 LICENSE-test
drwxr-xr-x. 4 root root 4.0K Jan 8 16:21 man
-rwxr-xr-x. 1 root root 1.6K Jan 8 16:21 mysqlrouter-log-rotate
-rwxr-xr-x. 1 root root 952 Jan 8 16:21 README
-rwxr-xr-x. 1 root root 679 Jan 8 16:21 README.router
-rwxr-xr-x. 1 root root 952 Jan 8 16:21 README-test
drwxr-xr-x. 2 root root 4.0K Jan 8 16:21 run
drwxr-xr-x. 28 root root 4.0K Jan 8 16:21 share
drwxr-xr-x. 2 root root 4.0K Jan 8 16:21 support-files
drwxr-xr-x. 3 root root 4.0K Jan 8 16:21 var
[root@localhost ~]#
[root@localhost ~]# useradd -ms /bin/bash polarx
[root@localhost ~]# echo "polarx:polarx" | chpasswd
[root@localhost ~]# echo "polarx ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
[root@localhost ~]# su - polarx
Welcome to 4.19.90-2003.4.0.0036.oe1.x86_64
System information as of time: Thu Jan 8 16:22:54 CST 2026
System load: 0.54
Processes: 101
Memory used: 3.6%
Swap used: 0.0%
Usage On: 21%
IP address: 192.168.122.10
Users online: 2
[polarx@localhost ~]$ mkdir polardbx-engine
[polarx@localhost ~]$ cd polardbx-engine && mkdir log mysql run data tmp
[polarx@localhost polardbx-engine]$ ll
total 20K
drwx------. 2 polarx polarx 4.0K Jan 8 16:23 data
drwx------. 2 polarx polarx 4.0K Jan 8 16:23 log
drwx------. 2 polarx polarx 4.0K Jan 8 16:23 mysql
drwx------. 2 polarx polarx 4.0K Jan 8 16:23 run
drwx------. 2 polarx polarx 4.0K Jan 8 16:23 tmp
[polarx@localhost polardbx-engine]$ vim my.cnf
[polarx@localhost polardbx-engine]$ cat my.cnf
[mysqld]
basedir = /opt/polardbx_engine
log_error_verbosity = 2
default_authentication_plugin = mysql_native_password
gtid_mode = ON
enforce_gtid_consistency = ON
log_bin = mysql-binlog
binlog_format = row
binlog_row_image = FULL
master_info_repository = TABLE
relay_log_info_repository = TABLE
# change me if needed
datadir = /home/polarx/polardbx-engine/data
tmpdir = /home/polarx/polardbx-engine/tmp
socket = /home/polarx/polardbx-engine/tmp.mysql.sock
log_error = /home/polarx/polardbx-engine/log/alert.log
port = 4886
cluster_id = 1234
cluster_info = 127.0.0.1:14886@1
server_id = 2712347953
[mysqld_safe]
pid_file = /home/polarx/polardbx-engine/run/mysql.pid
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ sudo yum install libaio-devel -y
Last metadata expiration check: 0:04:02 ago on Thu 08 Jan 2026 04:19:49 PM CST.
Dependencies resolved.
===============================================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================================
Installing:
libaio-devel x86_64 0.3.112-1.oe1 update 10 k
Upgrading:
libaio x86_64 0.3.112-1.oe1 update 21 k
Transaction Summary
===============================================================================================================================================
Install 1 Package
Upgrade 1 Package
Total download size: 32 k
Downloading Packages:
(1/2): libaio-devel-0.3.112-1.oe1.x86_64.rpm 26 kB/s | 10 kB 00:00
(2/2): libaio-0.3.112-1.oe1.x86_64.rpm 39 kB/s | 21 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------
Total 57 kB/s | 32 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : libaio-0.3.112-1.oe1.x86_64 1/3
Installing : libaio-devel-0.3.112-1.oe1.x86_64 2/3
Cleanup : libaio-0.3.111-5.oe1.x86_64 3/3
Running scriptlet: libaio-0.3.111-5.oe1.x86_64 3/3
Verifying : libaio-devel-0.3.112-1.oe1.x86_64 1/3
Verifying : libaio-0.3.112-1.oe1.x86_64 2/3
Verifying : libaio-0.3.111-5.oe1.x86_64 3/3
Upgraded:
libaio-0.3.112-1.oe1.x86_64
Installed:
libaio-devel-0.3.112-1.oe1.x86_64
Complete!
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ /opt/polardbx_engine/bin/mysqld --defaults-file=my.cnf --initialize-insecure
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ ^C
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ /opt/polardbx_engine/bin/mysqld_safe --defaults-file=my.cnf &
[1] 2817
[polarx@localhost polardbx-engine]$ 2026-01-08T08:28:27.115219Z mysqld_safe Logging to '/home/polarx/polardbx-engine/log/alert.log'.
2026-01-08T08:28:27.142472Z mysqld_safe Starting mysqld daemon with databases from /home/polarx/polardbx-engine/data
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ netstat -antp|grep 4886
-bash: netstat: command not found
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ sudo yum install net-tools -y
Last metadata expiration check: 0:09:03 ago on Thu 08 Jan 2026 04:19:49 PM CST.
Dependencies resolved.
===============================================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================================
Installing:
net-tools x86_64 2.0-0.54.oe1 OS 196 k
Transaction Summary
===============================================================================================================================================
Install 1 Package
Total download size: 196 k
Installed size: 869 k
Downloading Packages:
net-tools-2.0-0.54.oe1.x86_64.rpm 617 kB/s | 196 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------
Total 614 kB/s | 196 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : net-tools-2.0-0.54.oe1.x86_64 1/1
Running scriptlet: net-tools-2.0-0.54.oe1.x86_64 1/1
Verifying : net-tools-2.0-0.54.oe1.x86_64 1/1
Installed:
net-tools-2.0-0.54.oe1.x86_64
Complete!
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ netstat -antp|grep 4886
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::4886 :::* LISTEN 3134/mysqld
tcp6 0 0 :::14886 :::* LISTEN 3134/mysqld
[polarx@localhost polardbx-engine]$
[polarx@localhost polardbx-engine]$ /opt/polardbx_engine/bin/mysql -h127.0.0.1 -P4886 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.32-X-Cluster-8.4.19-20250825 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> select version();
+----------------------------------+
| version() |
+----------------------------------+
| 8.0.32-X-Cluster-8.4.19-20250825 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> ^DBye
[polarx@localhost polardbx-engine]$ cat /etc/openEuler-release
openEuler release 20.03 (LTS)
[polarx@localhost polardbx-engine]$ date
Thu Jan 8 16:29:21 CST 2026
[polarx@localhost polardbx-engine]$ date -R
Thu, 08 Jan 2026 16:29:23 +0800
[polarx@localhost polardbx-engine]$
关于笔者张阳,曾就职于 中国人保、麒麟软件、华为、铁科院、中广核工程、南方电网、华夏银行,欢迎有坑位的大大 chat w e: zhangyang_bigdata