ARM架构部署mysql-5.7.27

ARM架构部署mysql-5.7.27,第1张

借鉴:

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

银河麒麟V10 aarch64架构 linux系统安装mysql数据库,国产化环境,银河麒麟V10 *** 作系统,aarch64架构:

高版本的mysql,有支持arm架构,因此直接推荐安装高版本

一、下载mysql

二、清理历史环境:

1.查看系统是否自带MySQL和MariaDB

rpm -qa | grep mysql

rpm -qa | grep mariadb

rpm -e --nodeps mariadb-libs

rpm -e mariadb-server --nodeps

yum -y remove mysql*

yum -y remove mariadb*

2.删除MySQL和MariaDB相关包

rpm -e filename

yum remove 包名

3.查询所有的mysql相关文件,然后统统删除

find / -name mysql

三、开始安装

1.解压

tar -xvf mysql-8.0.28-1.el8.aarch64.rpm-bundle.tar

2.安装必须软件(务必根据顺序来)

rpm -ivh mysql-community-common-8.0.28-1.el8.aarch64.rpm

rpm -ivh mysql-community-client-plugins-8.0.28-1.el8.aarch64.rpm

rpm -ivh mysql-community-libs-8.0.28-1.el8.aarch64.rpm

rpm -ivh mysql-community-client-8.0.28-1.el8.aarch64.rpm

rpm -ivh mysql-community-icu-data-files-8.0.28-1.el8.aarch64.rpm

rpm -ivh mysql-community-server-8.0.28-1.el8.aarch64.rpm

3.修改配置文件

vim /etc/my.cnf

在末尾补一行:

lower_case_table_names=1

1:数据库大小写不敏感

0:数据库大小写敏感

4.初始化数据库

mysqld --initialize --console

5.目录授权

chown -R mysql:mysql /var/lib/mysql/

6.启动mysql服务

systemctl start mysqld

7.查看临时密码

cat /var/log/mysqld.log

8.用临时密码登录

mysql -u root -p

有的老铁这里就要震惊了,可能mysql不是有效命令之类的提示,那就:

9.编辑下环境变量

vim /etc/profile

末尾加上一行:

export PATH=$PATH:/usr/bin/mysq

10.修改密码

alter USER 'root'@'localhost' IDENTIFIED BY '123456'


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/8357859.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-15
下一篇 2023-04-15

发表评论

登录后才能评论

评论列表(0条)

保存