MySQL 下载地址:

https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz

安装教程:

1、添加mysql用户组和mysql用户:

 yum update -y 
 yum upgrade -y
 groupadd mysql
 useradd -g mysql mysql 
 usermod -a -G aid_inet,aid_net_raw mysql

2、安装依赖库:

 yum install -y libaio*

3、安装需要用着的指令:

yum install wget tar vim -y

4、下载解压Mysql:

 cd /usr/local/ 
 wget https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz 
 tar -zxvf mysql-5.7.27-aarch64.tar.gz 
 rm -rf mysql-5.7.27-aarch64.tar.gz

5、配置Mysql:

mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql
mkdir -p /usr/local/mysql/logs
chown -R mysql:mysql /usr/local/mysql 
ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.old
ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6

6、添加环境变量:

vim /etc/profile

在最下方添加:

export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin

保存退出后执行:

source /etc/profile

7、Mysql 初始化:

mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

8、MySQL启动,关闭

设置开机启动

cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld 
chmod +x /etc/init.d/mysqld

安装screen 挂后台

#安装screen
yum install screen -y
#创建screen
screen -S mysql

启动MySQL或关闭

#启动
service mysqld start 
#关闭
service mysqld start
#重启
service mysqld restart
#状况
service mysqld status
#{start|stop|restart|reload|force-reload|status}

启动完毕后按住 ctrl+A D挂起screen 并退出!

9、登录

mysql -uroot

安装结束!