scp /Users/yun/Desktop/mysql-8.0.28-1.el7.aarch64.rpm-bundle.tar [email protected]:/root
mkdir -p /usr/local/mysql
tar -xvf mysql-8.0.28-1.el7.aarch64.rpm-bundle.tar -C /usr/local/mysql
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.aarch64
1
rpm -ivh mysql-community-common-8.0.28-1.el7.aarch64.rpm
2
rpm -ivh mysql-community-client-plugins-8.0.28-1.el7.aarch64.rpm
3
rpm -ivh mysql-community-libs-8.0.28-1.el7.aarch64.rpm
4
rpm -ivh mysql-community-libs-compat-8.0.28-1.el7.aarch64.rpm
5
rpm -ivh mysql-community-client-8.0.28-1.el7.aarch64.rpm
6
rpm -ivh mysql-community-icu-data-files-8.0.28-1.el7.aarch64.rpm
7
rpm -ivh mysql-community-embedded-compat-8.0.28-1.el7.aarch64.rpm
8
yum install openssl-devel -y
9
rpm -ivh mysql-community-devel-8.0.28-1.el7.aarch64.rpm
10
yum install net-tools -y
11
yum install perl-Data-Dumper -y
yum install perl-JSON -y
yum install perl-Test-Simple -y
12
rpm -ivh mysql-community-server-8.0.28-1.el7.aarch64.rpm
13
rpm -ivh mysql-community-test-8.0.28-1.el7.aarch64.rpm
systemctl start mysqld.service
systemctl stop mysqld.service
systemctl status mysqld.service
systemctl restart mysqld.service
grep 'temporary password' /var/log/mysqld.log
mysql -u root -p
然后输入上述查询到的自动生成的密码, 完成登录 .
登录到MySQL之后,需要将自动生成的不便记忆的密码修改了,修改成自己熟悉的便于记忆的密码。
ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
执行上述的SQL会报错,原因是因为设置的密码太简单,密码复杂度不够。
set global validate_password.policy = 0;
set global validate_password.length = 4;
降低密码的校验规则之后,再次执行上述修改密码的指令。
ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
默认的root用户只能当前节点localhost访问,是无法远程访问的,我们还需要创建一个root账户,用户远程访问
create user 'root'@'%' IDENTIFIED WITH mysql_native_password BY '1234';
grant all on *.* to 'root'@'%';
mysql -u root -p
然后输入密码