You rename a MySQL user only very occasionally, but sometimes you need tofor instance, if your usernames are based on a user's real name and the person gets married. If Denise Black changes her surname to White, you would execute the following command to update her username: RENAME USER dblack@localhost TO dwhite@locahost; The RENAME USER command has been available since MySQL 5.0.2. In earlier versions of MySQL, you have to update the user table by hand, along with any corresponding rows in db, remembering to use the FLUSH PRIVIGES command afterward: UPDATE user SET User = 'dwhite' WHERE User = 'dblack' AND Host = 'localhost'; UPDATE db SET User = 'dwhite' WHERE User = 'dblack' AND Host = 'localhost'; FLUSH PRIVILEGES; |