服务器环境
在 arm64(aarch64) 架构服务器上基于国产化操作系统安装 Mysql 服务
## 查看系统版本,确认版本
cat /etc/kylin-release
Kylin Linux Advanced Server release V10 (Tercel)
## 操作系统
uname -p
aarch64
## 内核版本(≥ 3.10)
uname -r
4.19.90-21.2.ky10.aarch64
## iptables 版本(≥ 1.4)
iptables --version
iptables v1.8.1 (legacy)
软件安装
- 需先卸载
mariadb-server
、mariadb-common
yum remove mariadb-server mariadb-common
- 下载安装包
下载地址:https://downloads.mysql.com/archives/community/
可以直接用命令下载:
wget -c https://downloads.mysql.com/archives/get/p/23/file/mysql-8.1.0-1.el8.aarch64.rpm-bundle.tar
解压:
tar xvf mysql-8.1.0-1.el8.aarch64.rpm-bundle.tar
- 安装:
yum install -y ./mysql-community-server-8.1.0-1.el8.x86_64.rpm
yum install -y ./mysql-community-client-8.1.0-1.el8.x86_64.rpm
yum install -y ./mysql-community-libs-8.1.0-1.el8.x86_64.rpm
yum install -y ./mysql-community-server-8.1.0-1.el8.x86_64.rpm
yum install -y ./mysql-community-common-8.1.0-1.el8.x86_64.rpm
如果嫌弃麻烦,那就直接全部安装
yum install -y ./mysql-community-*
- 启动mysqld
systemctl start mysqld
- 设置开机启动
systemctl enable mysqld
6.MySQL默认密码和修改密码
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p
7. 修改密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'sfa33afFASD!@#';
- 重新登录