[TOC] # 锁定和解锁用户 ## 通过 SQL 语句锁定和解锁用户 * MySQL 模式 MySQL 模式的锁定和解锁用户示例如下: * 锁定用户 ~~~ obclient> ALTER USER demo ACCOUNT LOCK; Query OK, 0 rows affected (0.02 sec) obclient -udemo@demo0_111 -P2881 -h10.10.10.1 -pttt obclient: [Warning] Using a password on the command line interface can be insecure. ERROR 3118 (HY000): User locked ~~~ * 解锁用户 ~~~ obclient> ALTER USER demo ACCOUNT UNLOCK; Query OK, 0 rows affected (0.02 sec) obclient -udemo@demo0_111 -P2881 -h10.10.10.1 -pttt 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 3222145887 Server version: 5.7.25 OceanBase 2.2.74 (...) (Built Jul 15 2020 21:30:23) Copyright (c) 2000, 2018, 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. obclient> ~~~