1、rpm下载地址
https://www.oracle.com/java/technologies/downloads/#java8
安装MySQL
1.下载 wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar
2. 解压缩
tar -xvf mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar
3.安装四个服务:
rpm -ivh mysql-community-common-8.0.28-1.el8.x86_64.rpm --nodeps -force rpm -ivh mysql-community-libs-8.0.28-1.el8.x86_64.rpm --nodeps --force rpm -ivh mysql-community-client-8.0.28-1.el8.x86_64.rpm --nodeps --force rpm -ivh mysql-community-server-8.0.28-1.el8.x86_64.rpm --nodeps --force rpm -qa |grep mysql
4.初始化配置
mysqld --initialize
若出现问题运行此命令: yum install libaio*
chown mysql:mysql /var/lib/mysql -R
systemctl start mysqld.service
systemctl enable mysqld
命令查看 cat /var/log/mysqld.log|grep password
5.登陆数据库: mysql -uroot -p
修改身份认证方式:
ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘dddsafas’
6.修改数据库权限(创建数据库):
mysql> update user set host=’%’ where user=‘root’;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> create database blog;
Query OK, 1 row affected (0.01 sec)
mysql> create user ‘admin’@’%’ IDENTIFIED BY ‘123456’;
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL PRIVILEGES ON blog.* to ‘admin’@’%’;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> ^C
mysql> exits;
7.开墙
firewall-cmd --zone=public --add-port=3306/tcp --perm
firewall-cmd --reload
8.本地连接
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)