WordPress

How to Change WordPress Username Using MySQL

Due to security reason you may want to change your WordPress username, However, you can do this from the WordPress administrator console.

Instead, there is an easier way but rather advance for non-technical people. You can actually use phpMyAdmin to change the username manually in WordPress MySQL database or using the command line or SQL statement as below for your reference.

Change WordPress Username Using MySQL

Follow the below steps to change password.

1. First of all login to your Linux database server via ssh with root user user.

2. WordPress user’s details save in “wordpressdb” and “wp_users” table.

# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 62547
Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use wordpressdb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

3. Use below command to print existing “user_login, user_nicename, display_name” in wp_users table.

MariaDB [wordpressdb]> select user_login, user_nicename, display_name from wp_users;
+------------+---------------+--------------+
| user_login | user_nicename | display_name |
+------------+---------------+--------------+
| admin      | admin         | admin        |
+------------+---------------+--------------+
1 row in set (0.00 sec)

4. Update “user_login, user_nicename, display_name” in wp_users table to new prefered username, nickname and display name.

MariaDB [wordpressdb]> update wp_users SET user_login = 'problogger';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [wordpressdb]> update wp_users SET user_nicename = 'problogger';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [wordpressdb]> update wp_users SET display_name = 'problogger';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

5. Now again run the below command to print updated “user_login, user_nicename, display_name” in wp_users table.

MariaDB [wordpressdb]> select user_login, user_nicename, display_name from wp_users;
+------------+---------------+--------------+
| user_login | user_nicename | display_name |
+------------+---------------+--------------+
| problogger | problogger    | problogger   |
+------------+---------------+--------------+
1 row in set (0.00 sec)

Your WordPress username, nickname and display name has been changed successfully.

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment