暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

用户密码错误报错

SQL新手 2022-12-08
1333

本文为您介绍用户密码的相关报错及处理方式。

报错:ERROR 1045 (42000)

错误码

1045

错误信息

ERROR 1045 (42000) : Access denied for user '%.*s'@'%.*s' (using password: %s)

示例

登录 user 用户时忘记了密码。

[admin@**** /home/admin]
$obclient -h10.10.10.1 -P2881 -uny1@MySQL -p**8*** -A
obclient: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (42000): Access denied for user 'ny1'@'xxx.xxx.xxx.xxx' (using password: YES)

如何处理

  1. 登录 root 用户。

    [admin@**** /home/admin]
    $obclient -h10.10.10.1 -P2881 -uroot@MySQL -p_***2***_ -A
    obclient: [Warning] Using a password on the command line interface can be insecure.
    Welcome to the OceanBase monitor.  Commands end with ; or \g.
    Your OceanBase connection id is 3221678880
    Server version: 5.7.25 OceanBase 4.0.0 (r20220110212853-f55615d0df8c3c2ca5dcd6b5dba8f0acd18c6264) (Built Oct 10 2022 22:09:16)
    
    Copyright (c) 2000, 2022, OceanBase 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.
    
  2. 修改 ny1 密码。

    obclient> ALTER USER 'ny1' IDENTIFIED BY '**8***';
    Query OK, 0 rows affected
    
  3. 再次登录 ny1 用户。

    [admin@**** /home/admin]
    $obclient -h10.10.10.1 -P2881 -uny1@MySQL -p**8*** -A
    obclient: [Warning] Using a password on the command line interface can be insecure.
    Welcome to the OceanBase.  Commands end with ; or \g.
    Your OceanBase connection id is 3221678797
    Server version: 5.7.25 OceanBase 4.0.0 (r20220110212853-f55615d0df8c3c2ca5dcd6b5dba8f0acd18c6264) (Built Oct 10 2022 22:09:16)
    
    Copyright (c) 2000, 2022, OceanBase 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.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论