基于湖库一体架构,统一管理结构化、半结构化与非结构化等多模态数据,一个系统承载事务处理、实时分析与 AI 工作负载。
用户密码错误,错误代码 ERROR 1045
更新时间:2026-07-15 20:56:55
本文介绍 OceanBase 数据库 MySQL 模式下用户密码输入错误后报 ERROR 1045 错误的处理方法。
问题现象
用户登录数据库时,忘记了密码,导致密码输入错误,报错。
[admin@k08j13249.eu95sqa /home/admin]
$obclient -hxx.xx.xx.1 -P2881 -uny1@MySQL -p**8*** -A
ERROR 1045 (42000): Access denied for user 'ny1'@'xxx.xxx.xxx.xxx' (using password: YES)
该报错信息对应的错误码信息如下:
错误码:ERROR 1045
OceanBase 错误码:4043
兼容 MySQL 错误码:1045
有关错误码的详细说明及介绍,请参见 错误码概述。
解决方法
请参考以下步骤,修改用户密码后,重新登录。
使用管理员用户登录到集群相应的租户。
说明
修改用户密码的操作一般由管理员完成,普通用户如果需要修改其他用户的密码,必须具备全局
CREATE USER权限。修改用户
ny1的密码。obclient> ALTER USER 'ny1' IDENTIFIED BY '**8***'; Query OK, 0 rows affected说明
为用户设置密码时,用户密码需要符合当前租户的密码复杂度。密码复杂度相关操作及说明请参见 密码复杂度。
再次使用
ny1用户登录集群的MySQL租户。[admin@k08j13249.eu95sqa /home/admin] $obclient -h10.10.10.1 -P2881 -uny1@MySQL -p****** -A Welcome to the OceanBase monitor. Commands end with ; or \g. Your OceanBase connection id is 3221490183 Server version: 5.7.25 OceanBase 4.0.0.0 (r100000152022092610-404b3d7117dd0035698010c6e3b07948abc0e433) (Built Sep 26 2022 10:34:25) Copyright (c) 2000, 2018, OceanBase Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.