zoukankan      html  css  js  c++  java
  • 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 ~]#

  • 相关阅读:
    js函数与DOM
    js流程控制语句与数组
    js基础语法与表达式
    CSS
    注解使用IDEA的Filter注解模板
    JSP小结
    JSP的九大内置对象
    Mac上Sublime常用快捷键
    git cherry-pick: failed to refresh the index
    c++11之后类中定义常量的最好方法
  • 原文地址:https://www.cnblogs.com/dsab/p/8016265.html
Copyright © 2011-2022 走看看