• MySQL8.0初始化操作


    附海文网盘:https://help.seafile.com/zh/syncing_client/syncing_librarise.html
    https://www.jianshu.com/p/5c1198aefe71
    skip-grant-tables#直接跳过密码登录
    ###############################################
    default_authentication_plugin=mysql_native_password ##启动之前打开

    连接MySQL服务器,修改密码

    1.grep 'temporary password' /var/log/mysqld.log
    2.set global validate_password.policy=0;
    3.set global validate_password.length=6;
    4.alter user user() identified by "123456"; //修改登陆密码
    5.flush privileges;
    

    ###########################################
    用户授权和修改密码

    创建账号密码

    CREATE USER wangwei@127.0.0.1 IDENTIFIED BY 'passowrd';

    授予权限

    GRANT ALL ON . TO wangwei@127.0.0.1 WITH GRANT OPTION;

    删除权限

    REVOKE all privileges ON databasename.tablename FROM 'username'@'host';

    修改密码

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

    MySQL8.0中带过期时间用户的创建:

    CREATE USER `wangwei`@`127.0.0.1` IDENTIFIED BY 'wangwei' PASSWORD EXPIRE INTERVAL 90 DAY;
    GRANT ALL ON *.* TO `wangwei`@`127.0.0.1` WITH GRANT OPTION;
    

    ########################################################################
    default_authentication_plugin=mysql_native_password来改变认证加密方式
    update mysql.user set plugin='mysql_native_password';
    ###############################################################

    select Host,User,plugin,authentication_string from mysql.user;
    update user set authentication_string='' where user='root';
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
    

    ####################################################################################################
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用户密码
    FLUSH PRIVILEGES; #刷新权限

    ##########################################
    当plugin的认证方式改变后,之前的对应的plugin的认证密码将会失效。

  • 相关阅读:
    LoadRunner脚本关联动态数据的最简单方法
    LoadRunner 检查点函数总结
    算法(一)时间复杂度
    JAVA虚拟机总结
    java8中Lambda表达式和Stream API
    算法总结
    listview 异步加载图片并防止错位
    Java设计模式菜鸟系列(一)策略模式建模与实现
    Python基础--webbrowser
    Shiro学习(22)集成验证码
  • 原文地址:https://www.cnblogs.com/Haihong72H/p/13335363.html
Copyright © 2020-2023  润新知