建议直接使用在openEuler官方编译移植过的mysql-5.7.21系列软件包
参考:操作系统迁移实战之在openEuler上部署MySQL数据库 | 数据库迁移方案 | openEuler社区官网
MySQL 5.7.21 移植指南(openEuler 20.03 LTS SP1) | 数据库移植方案 | openEuler社区官网
下载地址:
aarch64地址:openeuler aarch64 下载地址
x86_64地址:openeuler x86-64 下载地址
找到对应的安装包
下载
wget https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/mysql5-server-5.7.21-3.oe1.aarch64.rpm
warning: mysql5-server-5.7.21-3.oe1.aarch64.rpm: Header V3 RSA/SHA1 Signature, key ID b25e7f66: NOKEY
error: Failed dependencies:
libc.so.6(GLIBC_2.28)(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libcrypt.so.1(XCRYPT_2.0)(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libcrypto.so.1.1()(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libevent_core-2.1.so.7()(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libmecab.so.2()(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libssl.so.1.1()(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libssl.so.1.1(OPENSSL_1_1_0)(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libstdc++.so.6(GLIBCXX_3.4.20)(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libstdc++.so.6(GLIBCXX_3.4.21)(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libtirpc.so.3()(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
libtirpc.so.3(TIRPC_0.3.0)(64bit) is needed by mysql5-server-5.7.21-3.oe1.aarch64
mysql is needed by mysql5-server-5.7.21-3.oe1.aarch64
mysql5-common = 5.7.21-3.oe1 is needed by mysql5-server-5.7.21-3.oe1.aarch64
mysql5-errmsg = 5.7.21-3.oe1 is needed by mysql5-server-5.7.21-3.oe1.aarch64
shadow is needed by mysql5-server-5.7.21-3.oe1.aarch64
缺失什么就安装什么。
下载mysql5-common、 mysql5-errmsg
wget https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/mysql5-common-5.7.21-3.oe1.aarch64.rpm
wget https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/mysql5-errmsg-5.7.21-3.oe1.aarch64.rpm
wget https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/mysql5-5.7.21-3.oe1.aarch64.rpm
wget https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/mariadb-common-10.3.9-9.oe1.aarch64.rpm
wget https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/mysql5-server-5.7.21-3.oe1.aarch64.rpm
wget https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/aarch64/Packages/mecab-0.996-2.oe1.aarch64.rpm
rpm -ivh mysql5-5.7.21-3.oe1.aarch64.rpm mariadb-common-10.3.9-9.oe1.aarch64.rpm mysql5-common-5.7.21-3.oe1.aarch64.rpm mysql5-errmsg-5.7.21-3.oe1.aarch64.rpm mysql5-server-5.7.21-3.oe1.aarch64.rpm
rpm -ivh mysql5-5.7.21-3.oe1.aarch64.rpm --force --nodeps
rpm -ivh mariadb-common-10.3.9-9.oe1.aarch64.rpm --force --nodeps
rpm -ivh mecab-0.996-2.oe1.aarch64.rpm --force --nodeps
rpm -ivh mysql5-common-5.7.21-3.oe1.aarch64.rpm
rpm -ivh mysql5-errmsg-5.7.21-3.oe1.aarch64.rpm
然后加上 --force --nodeps
rpm -ivh mysql5-server-5.7.21-3.oe1.aarch64.rpm --force --nodeps
systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
那就查看日志:
-- Subject: Unit mysqld.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has finished shutting down.
Aug 22 14:46:52 dc3-80-558.novalocal systemd[1]: Starting MySQL 5.7 database server...
-- Subject: Unit mysqld.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has begun starting up.
Aug 22 14:46:52 dc3-80-558.novalocal mysql-check-socket[4923]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-check-socket[4923]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-check-socket[4923]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-check-socket[4923]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: /usr/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: Initializing MySQL database
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: /usr/libexec/mysqld: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: Initialization of MySQL database failed.
Aug 22 14:46:52 dc3-80-558.novalocal mysql-prepare-db-dir[4952]: Perhaps /etc/my.cnf is misconfigured.
Aug 22 14:46:52 dc3-80-558.novalocal systemd[1]: mysqld.service: control process exited, code=exited status=127
Aug 22 14:46:52 dc3-80-558.novalocal systemd[1]: Failed to start MySQL 5.7 database server.
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has failed.
--
-- The result is failed.
Aug 22 14:46:52 dc3-80-558.novalocal systemd[1]: Unit mysqld.service entered failed state.
那就继续安装openssl:
去下载 openssl-1.1.1f-1.oe1.aarch64.rpm
rpm -ivh openssl-1.1.1f-1.oe1.aarch64.rpm --force --nodeps
rpm -ivh openssl-libs-1.1.1f-1.oe1.aarch64.rpm --force --nodeps
rpm -ivh glibc-common-2.28-49.oe1.aarch64.rpm --force --nodeps
rpm -ivh glibc-all-langpacks-2.28-49.oe1.aarch64.rpm --force --nodeps
rpm -ivh glibc- --force --nodeps