首先使用xftp上传mysql的linux压缩包
然后使用解压命令tar -xvf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
具体步骤如下 严格按照安装顺序安装 切记切记
[root@localhost ~]# tar -xvf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-8.0.28-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
mysql-community-common-8.0.28-1.el7.x86_64.rpm
mysql-community-devel-8.0.28-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.28-1.el7.x86_64.rpm
mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
mysql-community-libs-8.0.28-1.el7.x86_64.rpm
mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm
mysql-community-server-8.0.28-1.el7.x86_64.rpm
mysql-community-test-8.0.28-1.el7.x86_64.rpm
[root@localhost ~]# ll
总用量 1701628
drwxr-xr-x. 2 root root 6 7月 5 09:50 aaa
-rw-r--r--. 1 root root 137 7月 5 14:19 after.tar.gz
-rw-------. 1 root root 1701 11月 19 2021 anaconda-ks.cfg
drwxr--r--. 2 root root 99 7月 5 19:19 demo
-rw-r--r--. 1 root root 76 7月 5 14:10 demo.txt
drwxr-xr-x. 2 root root 6 7月 4 14:42 Desktop
drwxr-xr-x. 2 root root 6 7月 4 14:42 Documents
drwxr-xr-x. 2 root root 6 7月 5 19:31 Downloads
-rw-r--r--. 1 root root 1732 11月 19 2021 initial-setup-ks.cfg
-rw-r--r--. 1 root root 0 7月 5 15:42 lesson.sh
drwxr-xr-x. 2 root root 6 7月 4 14:42 Music
-rw-r--r--. 1 root root 843008000 7月 5 19:52 mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
-rw-r--r--. 1 7155 31415 55199948 12月 18 2021 mysql-community-client-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 5933684 12月 18 2021 mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 645388 12月 18 2021 mysql-community-common-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 7763684 12月 18 2021 mysql-community-devel-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 23637584 12月 18 2021 mysql-community-embedded-compat-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 2215928 12月 18 2021 mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 4935572 12月 18 2021 mysql-community-libs-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 1265072 12月 18 2021 mysql-community-libs-compat-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 473116268 12月 18 2021 mysql-community-server-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 268279684 12月 18 2021 mysql-community-test-8.0.28-1.el7.x86_64.rpm
-rw-r--r--. 1 root root 26 7月 5 14:10 my.txt
drwxr-xr-x. 2 root root 6 7月 4 14:42 Pictures
drwxr-xr-x. 2 root root 6 7月 4 14:42 Public
drwxr-xr-x. 3 root root 31 7月 5 14:28 ss
drwxr-xr-x. 2 root root 6 7月 4 14:42 Templates
drwxr-xr-x. 3 root root 71 7月 5 14:15 test
drwxr-xr-x. 2 root root 6 7月 4 14:42 Videos
-r--r--r--. 1 root root 56431201 11月 19 2021 VMwareTools-10.3.10-13959562.tar.gz
[root@localhost ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.65-1.el7.x86_64
[root@localhost ~]# rpm -e --nodes mariadb-libs
rpm: --nodes: 未知的选项
[root@localhost ~]# rpm -e --nodeps mariadb-libs
[root@localhost ~]# rpm -qa|grep mariadb
[root@localhost ~]# rpm -ivh mysql-community-common-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-common-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-common-8.0.28-1.e################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-client-plugins-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-client-plugins-8.################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-libs-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-libs-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-libs-8.0.28-1.el7################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-client-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-client-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-client-8.0.28-1.e################################# [100%]
[root@localhost ~]# rpm -ivh mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-icu-data-files-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-icu-data-files-8.################################# [100%]
[root@localhost ~]# mysql-community-server-8.0.28-1.el7.x86_64.rpm
bash: mysql-community-server-8.0.28-1.el7.x86_64.rpm: 未找到命令...
[root@localhost ~]# rpm -ivh mysql-community-server-8.0.28-1.el7.x86_64.rpm
警告:mysql-community-server-8.0.28-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-server-8.0.28-1.e################################# [100%]
[root@localhost ~]# mysqld --initialize --console
[root@localhost ~]# chown -R mysql:mysql /var/lib/mysql/
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# cat /var/log/mysqld.log|grep localhost
2022-07-05T12:16:17.447203Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 7viCSry?!5JP
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28
Copyright (c) 2000, 2022, 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> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.28 MySQL Community Server - GPL
Copyright (c) 2000, 2022, 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> exit
Bye
[root@localhost ~]#
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)