This topic describes how to handle ERROR 3118, where a user is locked in the MySQL mode of OceanBase Database.
Symptom
If you enter an incorrect password multiple times when you log on to the MySQL tenant as the ny1 user, 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
Error code compatible with MySQL Database: 3118
For more information about the error codes, see Overview of error messages.
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 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 affectedLog on to the tenant as the
ny1user 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.