共计 986 个字符,预计需要花费 3 分钟才能阅读完成。
MySQL 下载地址为:
https://obs.cn-north-4.myhuaw…
- 增加 mysql 用户组和 mysql 用户,用于隔离 mysql 过程
groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
2. 装置依赖库yum install -y libaio*
-
下载解压 Mysql
wget https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz
tar xzvf mysql-5.7.27-aarch64.tar.gz -C /usr/local/
4. 配置 Mysqlmv /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 cp -rf /usr/local/mysql/extra/lib* /usr/lib64/ 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
设置开机启动
cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld systemctl enable mysqld
- 增加环境变量
vim /etc/profile
增加上面两行代码:
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin
source /etc/profile
初始化 mysql
mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
开启 mysql
systemctl start mysqld
正文完