mysql8.0 arm 安装
https://mirrors.tools.huawei.com/mysql/Downloads/MySQL-8.0/
[root@xxx download]# tar -xvf mysql-8.0.24-1.el7.aarch64.rpm-bundle.tar [root@xxx download]# ls mysql-8.0.24-1.el7.aarch64.rpm-bundle.tar mysql-community-client-8.0.24-1.el7.aarch64.rpm mysql-community-client-plugins-8.0.24-1.el7.aarch64.rpm mysql-community-common-8.0.24-1.el7.aarch64.rpm mysql-community-devel-8.0.24-1.el7.aarch64.rpm mysql-community-embedded-compat-8.0.24-1.el7.aarch64.rpm mysql-community-libs-8.0.24-1.el7.aarch64.rpm mysql-community-libs-compat-8.0.24-1.el7.aarch64.rpm mysql-community-server-8.0.24-1.el7.aarch64.rpm mysql-community-test-8.0.24-1.el7.aarch64.rpm [root@xxx download]#
[root@xxx download]# rpm -qa | grep mariadb mariadb-libs-5.5.65-1.el7.aarch64 [root@xxx download]# yum remove mariadb-libs-5.5.65-1.el7.aarch64
[root@xxx download]# rpm -ivh mysql-community-common-8.0.24-1.el7.aarch64.rpm warning: mysql-community-common-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-common-8.0.24-1.e################################# [100%]
[root@xxx download]# rpm -ivh mysql-community-client-plugins-8.0.24-1.el7.aarch64.rpm warning: mysql-community-client-plugins-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-client-plugins-8.################################# [100%] [root@xxx download]#
[root@xxx download]# rpm -ivh mysql-community-libs-8.0.24-1.el7.aarch64.rpm warning: mysql-community-libs-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-libs-8.0.24-1.el7################################# [100%]
[root@xxx download]# rpm -ivh mysql-community-client-8.0.24-1.el7.aarch64.rpm warning: mysql-community-client-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-client-8.0.24-1.e################################# [100%]
[root@xxx download]# rpm -ivh mysql-community-server-8.0.24-1.el7.aarch64.rpm warning: mysql-community-server-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-server-8.0.24-1.e################################# [100%]
非必要安装
[root@xxx download]# rpm -ivh mysql-community-libs-compat-8.0.24-1.el7.aarch64.rpm warning: mysql-community-libs-compat-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-libs-compat-8.0.2################################# [100%]
[root@xxx download]# rpm -ivh mysql-community-embedded-compat-8.0.24-1.el7.aarch64.rpm warning: mysql-community-embedded-compat-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-embedded-compat-8################################# [100%]
[root@192-168-57-250 download]# rpm -ivh mysql-community-devel-8.0.24-1.el7.aarch64.rpm warning: mysql-community-devel-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies: pkgconfig(openssl) is needed by mysql-community-devel-8.0.24-1.el7.aarch64 [root@xxx download]# [root@xxx download]# yum install openssl-devel -y [root@xxx download]# openssl version OpenSSL 1.0.2k-fips 26 Jan 2017 [root@192-168-57-250 download]# rpm -ivh mysql-community-devel-8.0.24-1.el7.aarch64.rpm warning: mysql-community-devel-8.0.24-1.el7.aarch64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-devel-8.0.24-1.el################################# [100%]
初始化数据库
[root@xxx download]# mysqld --initialize --console
目录授权,否则启动失败
[root@xxx download]# chown -R mysql:mysql /var/lib/mysql/ [root@xxx download]# chown -R mysql:mysql /var/log/mysqld.log
启动msyql服务
[root@xxx download]# systemctl start mysqld [root@xxx download]# [root@xxx download]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2021-09-23 16:28:05 CST; 14s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 23641 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 23665 (mysqld) Status: "Server is operational" CGroup: /system.slice/mysqld.service └─23665 /usr/sbin/mysqld Sep 23 16:28:05 192-168-57-250 systemd[1]: Starting MySQL Server... Sep 23 16:28:05 192-168-57-250 systemd[1]: Started MySQL Server. [root@xxx download]#
在/var/log/mysqld.log下查看临时密码
[root@xxx download]# cat /var/log/mysqld.log | grep root 2021-09-23T08:26:06.993966Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: bd6;tjB0m0ju [root@xxx download]#
用临时密码登录到数据库
[root@192-168-57-250 download]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.24 Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
然后执行 mysql -uroot -p ,输入上面的到的密码进入,用该密码登录后,必须马上修改新的密码,不然会报如下错误:
mysql> use mysql;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
设置新密码,密码需要设置复杂一些
执行下列mysql命令 修改密码
mysql> alter user 'root'@'localhost' identified by 'IqSDYF(TD2020'; Query OK, 0 rows affected (0.01 sec) mysql>
依次执行下列mysql命令 授权远程连接
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.01 sec) mysql> mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> mysql> select host, user, authentication_string, plugin from user; +-----------+------------------+------------------------------------------------------------------------+-----------------------+ | host | user | authentication_string | plugin | +-----------+------------------+------------------------------------------------------------------------+-----------------------+ | localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | | localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | | localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | | localhost | root | $A$005$JX"nu@gC ,e-i%!r%L9XBr013HMjLXV.xwEYdK0ahNDK77mHkmpxAkosUo/0 | caching_sha2_password | +-----------+------------------+------------------------------------------------------------------------+-----------------------+ 4 rows in set (0.00 sec) mysql>
host为localhsot,说明用户只能本地连接msyql服务
mysql> update user set host = "%" where user='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql>