This topic describes how to handle ERROR 3118, where a user is locked in OceanBase Database in MySQL mode.
Symptom
If you enter an incorrect password multiple times when you log on to the MySQL tenant by using the ny1 user account, the system reports an error indicating that the user is locked.
[admin@k08j13249.eu95sqa /home/admin]
$obclient -h10.10.10.1 -P2881 -uny1@MySQL -p**8*** -A
ERROR 3118 (HY000): User locked
The error codes corresponding to this error message are as follows:
Error code: ERROR 3118
Error code in OceanBase Database: 5039
MySQL error code: 3118
For more information about the error codes, see Error code overview.
Possible causes
OceanBase Database provides a mechanism to handle logon failures. If a user fails to log on to OceanBase Database multiple times, OceanBase Database locks the account of the user to prevent malicious password attacks. This improves the security of OceanBase Database. For more information about how to handle logon failures, see Handle logon failures.
Troubleshooting procedure
Take the following steps to unlock the user and log on again.
Log on to the tenant as the administrator. The default username of the administrator of a MySQL tenant is
root.Note
If you log on as the administrator, you can directly unlock users. If you log on as a regular user, you must have the global
CREATE USERprivilege to unlock users.Unlock the
ny1user.obclient> ALTER USER 'ny1' account UNLOCK; Query OK, 0 rows affectedUse the
ny1account to log on to the corresponding tenant of the database again.[admin@k08j13249.eu95sqa /home/admin] $obclient -hxx.xx.xx.1 -P2881 -uny1@MySQL -p**8*** -A Welcome to the OceanBase monitor. Commands end with ; or \g. Your OceanBase connection id is 3221506686 Server version: 5.7.25 OceanBase 4.0.0.0 (r100000172022101218-6ab80a3950710941946c004d805fcfded7a4aa2c) (Built Oct 12 2022 18:43:39) Copyright (c) 2000, 2018, OceanBase Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.