CentOS7 安装 mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar

Posted 遥~

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7 安装 mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar相关的知识,希望对你有一定的参考价值。

一、download and upload to CentOS7 "mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar"

二、install

 1 [root@liuhonglei ~]# ls
 2 anaconda-ks.cfg  easy-mock  mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar
 3 [root@liuhonglei ~]#mkdir /usr/local/mysql/ && mv mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar /usr/local/mysql/
 4 [root@liuhonglei ~]# cd /usr/local/mysql/
 5 [root@liuhonglei mysql]# ls
 6 mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar
 7 [root@liuhonglei mysql]# tar -xvf mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar  
 8 mysql-community-libs-8.0.20-1.el7.x86_64.rpm
 9 mysql-community-embedded-compat-8.0.20-1.el7.x86_64.rpm
10 mysql-community-test-8.0.20-1.el7.x86_64.rpm
11 mysql-community-common-8.0.20-1.el7.x86_64.rpm
12 mysql-community-devel-8.0.20-1.el7.x86_64.rpm
13 mysql-community-client-8.0.20-1.el7.x86_64.rpm
14 mysql-community-libs-compat-8.0.20-1.el7.x86_64.rpm
15 mysql-community-server-8.0.20-1.el7.x86_64.rpm
16 [root@liuhonglei mysql]# rpm -ivh mysql-community-common-8.0.20-1.el7.x86_64.rpm --nodeps --force
17 [root@liuhonglei mysql]# rpm -ivh mysql-community-libs-8.0.20-1.el7.x86_64.rpm --nodeps --force
18 [root@liuhonglei mysql]# rpm -ivh mysql-community-client-8.0.20-1.el7.x86_64.rpm --nodeps --force
19 [root@liuhonglei mysql]# rpm -ivh mysql-community-server-8.0.20-1.el7.x86_64.rpm --nodeps --force
20 [root@liuhonglei mysql]# mysqld --initialize
21 [root@liuhonglei mysql]# chown mysql:mysql /var/lib/mysql -R
22 [root@liuhonglei mysql]# systemctl start mysqld.service
23 [root@liuhonglei mysql]# systemctl enable mysqld
24 [root@liuhonglei mysql]# cat /var/log/mysqld.log|grep password 
25 2020-07-18T00:19:30.205562Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: =&uZyx=8+)e<
26 [root@liuhonglei mysql]# mysql -u root -p
27 Enter password: 
28 Welcome to the MySQL monitor.  Commands end with ; or g.
29 mysql> alter user root@localhost identified with mysql_native_password by lhl545366;
30 Query OK, 0 rows affected (0.12 sec)
31 mysql> flush privileges;
32 Query OK, 0 rows affected (0.06 sec)
33 mysql> create user root@192.168.1.100 identified with mysql_native_password by lhl545366;
34 Query OK, 0 rows affected (0.69 sec)
35 mysql> grant all privileges on *.* to root@192.168.1.100 with grant option;
36 Query OK, 0 rows affected (0.17 sec)
37 mysql> flush privileges;
38 Query OK, 0 rows affected (0.05 sec)
39 mysql> quit;
40 [root@liuhonglei mysql]# firewall-cmd --get-zones
41 block dmz drop external home internal public trusted work
42 [root@liuhonglei mysql]# firewall-cmd --zone=public --permanent --add-port=3306/tcp
43 success
44 [root@liuhonglei mysql]# firewall-cmd --reload
45 success

 

以上是关于CentOS7 安装 mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar的主要内容,如果未能解决你的问题,请参考以下文章

centos7怎么安装 centos7安装步骤

centos7怎么安装 centos7安装步骤

centos7怎么安装 centos7安装步骤

centos7安装教程?

如何安装Centos7

安装centos7正在执行安装后设置需要多久