arm机器上安装mysql5.7

MySQL下载地址为:

https://obs.cn-north-4.myhuaw...

  1. 添加mysql用户组和mysql用户,用于隔离mysql进程
    groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
    2.安装依赖库
    yum install -y libaio*
  2. 下载解压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.配置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
     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
  3. 添加环境变量
    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

你可能感兴趣的