• ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 忘记mysql密码


    [root@mysql-db03 ~]# mysql -uroot -poldboy123
    Warning: Using a password on the command line interface can be insecure.
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    [root@mysql-db03 ~]# /etc/init.d/mysqld restart
    Shutting down MySQL.. SUCCESS!
    Starting MySQL. SUCCESS!
    [root@mysql-db03 ~]# mysql
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1
    Server version: 5.6.36 Source distribution

    Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

    mysql> use mysql;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    mysql> update user set password=password("123456") where user="root";
    Query OK, 4 rows affected (0.01 sec)
    Rows matched: 4 Changed: 4 Warnings: 0

    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

    mysql> ^DBye
    [root@mysql-db03 ~]# mysql -uroot -p123456
    Warning: Using a password on the command line interface can be insecure.
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 2
    Server version: 5.6.36 Source distribution

    Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

    mysql> ^DBye
    [root@mysql-db03 ~]#

  • 相关阅读:
    android面试之怎么把图片变成圆形
    android面试之contentProvider获取联系人
    Android面试之assets和aw文件的使用
    Android设计模式之面试
    Activity、Window、View的关系
    ViewPager的简单用法
    补间动画
    帧动画
    android系统的样式和主题
    C++的三种继承方式简述
  • 原文地址:https://www.cnblogs.com/dsab/p/8016265.html
Copyright © 2020-2023  润新知