目录
- 环境说明
- 虚拟机安装
- MySQL下载
- 步骤
- 1.卸载系统自带的mariadb-lib
- 2.上传安装包并解压
- 3.按顺序安装
- 4.初始化数据库
- 5.目录授权,否则启动失败
- 6.启动msyql服务
- 7.查看msyql服务的状态
- 8.在/var/log/mysqld.log下查看临时密码
- 9.用临时密码登录到数据库
- 10.执行下列mysql命令 修改密码
- 10.允许远程连接
- 简记m1主机安装MySQL
环境说明
主机:osx 12.0 arm64
虚拟机:VMWare 13.0 arm64
CentOS:centos7 aarch64
MySQL版本:mysql-8.0.31 aarch64
虚拟机安装
参考
https://blog.csdn.net/qq_24950043/article/details/122517521
MySQL下载
https://dev.mysql.com/downloads/mysql/
步骤
1.卸载系统自带的mariadb-lib
查看mariadb版本
rpm -qa | grep mariadb
卸载mariadb
rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
删除mariadb默认配置文件
rm -rf /etc/my.cnf
重启机器
reboot
2.上传安装包并解压
mkdir /export/software
将mysql-8.0.31-1.el7.aarch64.rpm-bundle.tar
安装包上传到/export/software目录(目录非固定)
解压mysql安装包到/export/server目录(目录非固定)
mkdir /export/server
tar -xvf mysql-8.0.31-1.el7.aarch64.rpm-bundle.tar -C /export/server
3.按顺序安装
yum install numactl openssl-devel.aarch64 openssl.aarch64 autoconf perl.aarch64 perl-devel.aarch64 perl-JSON.noarch -y
安装
rpm -ivh mysql-community-common-8.0.31-1.el7.aarch64.rpm
rpm -ivh mysql-community-client-plugins-8.0.31-1.el7.aarch64.rpm
rpm -ivh mysql-community-libs-8.0.31-1.el7.aarch64.rpm
rpm -ivh mysql-community-client-8.0.31-1.el7.aarch64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.31-1.el7.aarch64.rpm
rpm -ivh mysql-community-server-8.0.31-1.el7.aarch64.rpm
4.初始化数据库
mysqld --initialize --console
5.目录授权,否则启动失败
chown -R mysql:mysql /var/lib/mysql/
6.启动msyql服务
systemctl start mysqld
将mysql服务设置为开机启动
systemctl enable mysqld
7.查看msyql服务的状态
service mysqld status
8.在/var/log/mysqld.log下查看临时密码
cat /var/log/mysqld.log | grep password
9.用临时密码登录到数据库
mysql -u root -p
10.执行下列mysql命令 修改密码
alter USER 'root'@'localhost' IDENTIFIED BY '新密码';
10.允许远程连接
update from mysql.user set host='%' where user='root';
flush privileges;
简记m1主机安装MySQL
关键命令
arch -arm64 brew install mysql # 默认没有密码
mysql_secure_installation # 初始化密码,请记住初始化的密码
mysql.server start # 启动mysql服务
参考:
https://blog.csdn.net/Morris_/article/details/119209524?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-119209524-blog-123467460.pc_relevant_3mothn_strategy_recovery&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-119209524-blog-123467460.pc_relevant_3mothn_strategy_recovery&utm_relevant_index=2
心得:arm版本安装参考资料少,记录一下,方便以后使用