ARM64架构下面安装mysql5.6.44全过程

  1. 添加mysql用户组和mysql用户,用于隔离mysql进程

groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql

2.安装依赖库

yum install -y libaio*

  1. 下载解压Mysql

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

tar xzvf mysql-5.6.44-aarch64.tar.gz -C /usr/local/

4.配置Mysql

mv /usr/local/mysql-5.6.44-aarch64 /usr/local/mysql

mkdir -p /usr/local/mysql/logs

mkdir -p /data/mysql

chown -R mysql:mysql /usr/local/mysql

chown -R mysql:mysql /data/mysql

5.先检查一下有没有autoconf,如果没有请安装(yum install -y autoconf)

rpm -qa | grep autoconf

初始化数据库:

/usr/local/mysql/scripts/mysql_install_db --user=mysql

6.到这里会在/usr/local/mysql目录底下生成一个my-new.cnf文件,修改名字为my.cnf,同时修改里面的内容

ln -sf /usr/local/mysql/my.cnf /etc/my.cnf (ps:务必要用全路径)

7.设置开机启动

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

chmod +x /etc/init.d/mysqld

systemctl enable mysqld

8.添加环境变量

vim /etc/profile

添加下面两行代码:
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin

source /etc/profile

9.启动mysql

systemctl start mysqld

10.检查启动情况

systemctl status mysqld

你可能感兴趣的:(工具类,mysql)