美文网首页MySQL
ARM架构部署mysql-5.7.27

ARM架构部署mysql-5.7.27

作者: 綮珹 | 来源:发表于2022-06-22 17:50 被阅读0次

借鉴:

https://blog.csdn.net/YKWNDY/article/details/107025041

https://blog.csdn.net/weixin_41919735/article/details/122554337

cd /usr/local

将部署包:mysql-5.7.27-aarch64.tar.gz 上传到 /usr/local 下

tar xvf mysql-5.7.27-aarch64.tar.gz

mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql

mkdir -p /usr/local/mysql/logs

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

groupadd mysql

useradd -g mysql mysql

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

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

mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

systemctl start mysqld

systemctl status mysqld

移动文件 mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql

创建logs目录 mkdir -p /usr/local/mysql/logs

ln -sf a b 建立软连接,b指向a:ln -sf /usr/local/mysql/my.cnf /etc/my.cnf

cp是linux里的拷贝命令-r 是用于目录拷贝时的递归操作-f 是强制覆盖:cp -rf /usr/local/mysql/extra/lib* /usr/lib64/

创建mysql组:ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6

创建mysql用户添加到mysql组:groupadd mysql && useradd -g mysql mysql

将/usr/loca/mysql目录包含所有的子目录和文件,所有者改变为root,所属组改变为mysql:chown -R mysql:mysql /usr/local/mysql

设置开机启动:

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: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

查看状态:systemctl status mysqld

相关文章

网友评论

    本文标题:ARM架构部署mysql-5.7.27

    本文链接:https://www.haomeiwen.com/subject/cpyuvrtx.html