标签:client 错误 mic mysql 数据库 strong user with mkdir nat
[root@localhost home]$ rpm -qa|grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
[root@localhost home]$ yum remove? -y? mariadb-libs-5.5.56-2.el7.x86_64
1、在官网上[https://dev.mysql.com/downloads/mysql/)寻找到与操作系统相对应版本的mysql安装包。
这里下载的是:https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar
其他下载链接:[https://mirrors.tuna.tsinghua.edu.cn/mysql/)(下载速度会快点)
2、下载好通过MobaXterm 上传
cd /usr/local/
新建mysql目录
mkdir mysql
选择安装包,/opt/mysql上传到 目录下
解压安装包
tar -xvf mysql-8.0.20-1.el7.x86_64.rpm-bundle.tar
依次安装
common --> libs --> clients --> server
安装common
rpm -ivh mysql-community-common-8.0.20-1.el7.x86_64.rpm --nodeps --force
安装libs
rpm -ivh rpm -ivh mysql-community-libs-8.0.20-1.el7.x86_64.rpm --nodeps --force
rpm -ivh rpm -ivh mysql-community-libs-compat-8.0.20-1.el7.x86_64.rpm --nodeps --force
安装clients
rpm -ivh rpm -ivh mysql-community-client-8.0.20-1.el7.x86_64.rpm --nodeps --force
安装server
rpm -ivh rpm -ivh mysql-community-server-8.0.20-1.el7.x86_64.rpm --nodeps --force
查看 mysql 安装包
rpm -qa | grep mysql
通过以下命令,完成对 mysql 数据库的初始化和相关配置
mysqld --initialize;
chown mysql:mysql /var/lib/mysql -R;
systemctl start mysqld.service;
systemctl enable mysqld;
cat /var/log/mysqld.log | grep password;
先创建用户:
mysql>create user admin@‘%‘ identified by ‘Root.123456‘;
对用户赋予权限:
mysql> grant all privileges on *.* to admin@‘%‘ with grant option;
最后执行,使我们的配置生效:
mysql>flush privileges;
mysql8.0默认的加密规则是:caching_sha2_password,我们必须使用同等级的远程客户端才能连接,否则会报:Unable to load authentication plugin ‘caching_sha2_password 的错误
如果不想使用,可以修改用户的加密规则为 mysql_native_password,命令如下:
mysql>alter user ‘admin‘@‘%‘ IDENTIFIED with mysql_native_password by ‘Root.123456‘;
如此我们就可以对我们的mysql8进行远程操作了。
win10+virtualBox(CentOS7)java 环境搭建之 mysql8安装
标签:client 错误 mic mysql 数据库 strong user with mkdir nat
原文地址:https://www.cnblogs.com/7day/p/12810879.html