zoukankan      html  css  js  c++  java
  • MySQL 8.0 配置mysql_native_password身份验证插件的密码

    MySQL 8.0 配置mysql_native_password身份验证插件的密码

    mysql8.0的默认密码验证不再是password。所以在创建用户时,create user 'username'@'%' identified by 'password'; 客户端是无法连接服务的。

    方法一:

    登录MySQL后输入:

    ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

    FLUSH PRIVILEGES;

    方法二:

    编辑my.cnf文件,更改默认的身份认证插件。比如说:

    vim /data/mysql/mysql_3306/my_3306.cnf

    # 在[mysqld]中添加下边的代码
    default_authentication_plugin=mysql_native_password

    这个需要重启服务才生效。

    mysql> select user,host,plugin from mysql.user;        
    +------------------+-----------+-----------------------+
    | user             | host      | plugin                |
    +------------------+-----------+-----------------------+
    | bak              | %         | mysql_native_password |
    | monitor          | %         | mysql_native_password |
    | repuser          | %         | caching_sha2_password |
    | mysql.infoschema | localhost | caching_sha2_password |
    | mysql.session    | localhost | caching_sha2_password |
    | mysql.sys        | localhost | caching_sha2_password |
    | repuser          | localhost | caching_sha2_password |
    | root             | localhost | caching_sha2_password |
    +------------------+-----------+-----------------------+
    8 rows in set (0.00 sec)




  • 相关阅读:
    OnWndMsg处理功能
    SpringMVC Ajax返回的请求json 的方式来解决在中国字符串乱码问题
    【Shell剧本练习】得出的结论是当前用户
    C++指针和引用简介
    HDU 3126 Nova [2009 Asia Wuhan Regional Contest Online]
    工作过程的编译器
    ubuntu selinux
    Maven创建工程 WEB
    Weblogic集群
    Dubbo
  • 原文地址:https://www.cnblogs.com/bjx2020/p/12118614.html
Copyright © 2011-2022 走看看