Linux CentOS7系统 mysql 8.0.19:安装

前面安装教程建议参考:https://www.runoob.com/mysql/mysql-install.html
安装前准备: 删除 mysql数据库 和mariadb 自带的数据库(若有)
只说下安装后容易遇到的坑:

密码重置:

/etc/my.cnf

配置: skip-grant-tables  这样可以不输入密码进入mysql

进入mysql,首先刷新权限

flush privileges;

然后查看表结构,可以看到密码字段是authentication_string

update user set authentication_string=password('123456') where user='root';

flush privileges;

 

用户授权远程访问:

#创建账户
create user 'root'@'%' identified by  'password'
#赋予权限,with grant option这个选项表示该用户可以将自己拥有的权限授权给别人
grant all privileges on *.* to 'root'@'%' with grant option
#改密码&授权超用户,flush privileges 命令本质上的作用是将当前user和privilige表中的用户信息/权限设置从mysql库(MySQL数据库的内置库)中提取到内存里
flush privileges;

 

mysql 客户端远程登陆:Client does not support authentication protocol requested by server ; consider upgrading MySQL client

解决方案:1升级驱动   大家可以试一下

2 修改数据库加密规则

 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码';

FLUSH PRIVILEGES;    

 

posted @ 2020-04-02 17:26  蚂蚁style  阅读(1647)  评论(0编辑  收藏  举报