zoukankan      html  css  js  c++  java
  • MySQL 8.0之后版本密码修改

    MySQL刚刚安装完毕时

    • mysqld --initialize
    • grep password /var/log/mysqld.log 获取临时密码
    • mysql -uroot -p 输入临时密码登录MySQL
    • alter user 'root'@'localhost' identified by 'new@password';
    • 如果忘记或者丢失了临时密码, 重新使用mysqld --initialize

    MySQL在使用中修饰了密码

    • mysqld --user=mysql --skip-grant-tables &
    • mysql -uroot 登录MySQL
    • flush privileges; # 否则无法使用对用户操作的命令
    • alter user 'root'@'localhost' identified by 'new@password'; # 这样是不可以的, 会报错, 不可以对root用户修改密码, 我们只好创建一个新的有超级管理权限的用户
    • create user 'admin'@'localhost' identified by 'new@password'; # 先创建一个普通的admin用户
    • grant all on . 'admin'@'localhost'; # 赋予admin用户所有权限
  • 相关阅读:
    combiner中使用状态模式
    了解Shell
    优秀工具推荐
    linux安装weblogic10.3
    FastDFS上传下载(上)
    java压缩工具类
    06链表
    05数组
    04时间复杂度
    03复杂度
  • 原文地址:https://www.cnblogs.com/megachen/p/9576946.html
Copyright © 2011-2022 走看看