目录
(1).到mysql官方网站MySQL :: Download MySQL Community Server (Archived Versions)
(1).打开VMware Fusion 和FinalShell连接,mkdir(创建目录)添加pakage文件夹和softwares文件夹,这两个文件夹负责分开存放mysql的解压包和压缩包。
(2)rz上传下载完成的mysql压缩包,ll查看是否成功上传。
(12)重新连接mysql,按住control+z停止mysql,重新输入密码进入mysql
1.下载mysql
(1).到mysql官方网站MySQL :: Download MySQL Community Server (Archived Versions)
(2)下载RPM Bundle
2.安装mysql
(1).打开VMware Fusion 和FinalShell连接,mkdir(创建目录)添加pakage文件夹和softwares文件夹,这两个文件夹负责分开存放mysql的解压包和压缩包。
(2)rz上传下载完成的mysql压缩包,ll查看是否成功上传。
(3)解压tar包,到pakage目录下ll查看
tar -xvf mysql-8.0.28-1.el7.aarch64.rpm-bundle.tar -C /opt/pakage
(4)查询当前系统中安装的名称带mariadb的软件
rpm -qa | grep mariadb
(5)卸载 mariadb,具体指令为:
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.aarch64
(6)顺序 注:必须依照顺序
rpm -ivh mysql-community-common-8.0.28-1.el7.aarch64.rpm
rpm -ivh mysql-community-client-plugins-8.0.28-1.el7.aarch64.rpm
rpm -ivh mysql-community-libs-8.0.28-1.el7.aarch64.rpm
rpm -ivh mysql-community-libs-compat-8.0.28-1.el7.aarch64.rpm
rpm -ivh mysql-community-client-8.0.28-1.el7.aarch64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.28-1.el7.aarch64.rpm
rpm -ivh mysql-community-embedded-compat-8.0.28-1.el7.aarch64.rpm
yum install openssl-devel -y
rpm -ivh mysql-community-devel-8.0.28-1.el7.aarch64.rpm
yum install net-tools -y
yum install perl-Data-Dumper -y
yum install perl-JSON -y
yum install perl-Test-Simple -y
rpm -ivh mysql-community-server-8.0.28-1.el7.aarch64.rpm
rpm -ivh mysql-community-test-8.0.28-1.el7.aarch64.rpm
(7)启动mysql服务
systemctl start mysqld.service
systemctl stop mysqld.service
systemctl status mysqld.service
systemctl restart mysqld.service
(8)查询自动生成的root用户密码
grep 'temporary password' /var/log/mysqld.log
(9)命令行执行指令
mysql -u root -p
然后输入上述查询到的自动生成的密码, 完成登录
(10)修改root用户密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewStrongPassword123!';
(11)设置密码的复杂度为简单类型,密码长度为4。
set global validate_password.policy = 0;
set global validate_password.length = 4;
降低密码的校验规则之后,再次执行上述修改密码的指令。
ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
(12)重新连接mysql,按住control+z停止mysql,重新输入密码进入mysql
mysql -u root -p