添加mysql用户组和mysql用户
安装依赖libaio
yum install -y libaio*
下载Mysql
wget https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz
安装mysql
解压Mysql
tar xvf mysql-5.7.27-aarch64.tar.gz -C /usr/local/
重命名
mv mysql-5.7.27-aarch64/ mysql
创建log文件
mkdir -p /usr/local/mysql/logs
授权mysql用户
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/
配置libstdc
mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.oldln -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/mysqldsystemctl 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
查看mysql 状态
systemctl status mysqld
登录mysql
mysql -u root
设置密码
use mysql;
update user set authentication_string=password("123456") where user="root";
flush privileges;
设置远程连接
grant all privileges on *.* to root@'%' identified by "123456";
flush privileges;
quit
修改my.conf文件
bind-address = 0.0.0.0
远程访问一下