RENAME USER <旧用户> TO <新用户>
其中:mysql> RENAME USER 'test1'@'localhost' -> TO 'testUser1'@'localhost'; Query OK, 0 rows affected (0.03 sec)在 cmd 命令行工具中,使用 testUser1 用户登录数据库服务器,如下所示。
C:\Users\USER>mysql -h localhost -u testUser1 -p Enter password: ***** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.7.20-log MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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.
本文链接:http://task.lmcjl.com/news/14905.html