? ? ? ?https://downloads.mysql.com/archives/community/?
tar -zxvf mysql-8.1.0-linux-glibc2.28-aarch64.tar.xz -C /usr/local
mv /usr/local/mysql-8.1.0-linux-glibc2.28-aarch64 /usr/local/mysql
groupadd mysql
ueradd -r -g mysql mysql
chmod ug+rwx /data/mysql/*
chown mysql:mysql -R /data/mysql/*
mkdir -p /data/mysql/3310
mkdir -p /data/mysql/3311
/usr/local/mysql/bin/mysqld --initialize-insecure --datadir=/data/mysql/3310/data --user=mysql
/usr/local/mysql/bin/mysqld --initialize-insecure --datadir=/data/mysql/3311/data --user=mysql
? ? 3310的配置
cat >> /data/mysql/3311/my.cnf << EOF
[mysqld]
bind-address=0.0.0.0
port=3310
basedir=/usr/local/mysql
datadir=/data/mysql/3310/data
socket=/data/mysql/3310/mysql.sock
log-bin=/data/mysql/3310//data/mysql-bin
server-id=3310
[mysqld_safe]
log-error=/data/mysql/3310/mysqld_error.log
pid-file=/data/mysql/3310/mysqld.pid
EOF
? 3311的配置
cat >> /data/mysql/3311/my.cnf <<
[mysqld]
bind-address=0.0.0.0
port=3311
basedir=/usr/local/mysql
datadir=/data/mysql/3311/data
socket=/data/mysql/3311/mysql.sock
log-bin=/data/mysql/3311//data/mysql-bin
server-id=3311
[mysqld_safe]
log-error=/data/mysql/3311/mysqld_error.log
pid-file=/data/mysql/3311/mysqld.pid
EOF
? ? 启动3310
/usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/3310/my.cnf 2>&1 > /var/log/mysql3310.log &
? ?启动3311
/usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/3311/my.cnf 2>&1 > /var/log/mysql3311.log &
? ?检测启动状态
ps -ef | grep msyqld
/usr/local/mysql/bin/mysql -h 127.0.0.1 -P 3310 -u root
/usr/local/mysql/bin/mysql -h 127.0.0.1 -P 3311 -u root
? 设置root密码
update user set authentication_string="root!2018LC" where user="root"