Jump to: navigation, search

Mysql RENAME

From w3cyberlearnings

Contents

MySQL Rename Function

This function rename MySQL user account.

Syntax Rename

  • old: is the old user name
  • oldhost: is the old host name
  • new: is the new user name
  • newhost: is the new host name
RENAME USER old@oldhost TO new@newhost;

Example 1:Rename user name

mysql> RENAME USER 'john'@'localhost' TO 'john3'@'localhost';
Query OK, 0 rows affected (0.42 sec)


Example 2:Rename user name and host


mysql> RENAME USER 'hob'@'localhost' TO 'hob3'@'10.8.4.145';
Query OK, 0 rows affected (0.00 sec)

Related Links


---CREATE USER--- DROP USER--- GRANT User Privilege--- RENAME USER--- REVOKE--- SET PASSWORD---


Navigation
Web
SQL
MISC
References