WordPress is designed to give you flexibility, but the most efficient way to perform a task is to do it through the dashboard. You can find almost all aspects of the installation here, usually through an intuitive graphical user interface (GUI) to assist you. But sometimes, using a dashboard might not be the best approach. For example, you might want to add new users through a MySQL database instead of using a dedicated screen in WordPress.

How to Add WordPress New User via MySQL Database?

While we don’t recommend poking around in a MySQL database for day-to-day tasks, setting up users through the database seems like a simple and crude approach when you don’t have access to the dashboard. It’s an extreme solution to a unique problem, but if you need it, it’s your only solution.

In this post, we will show you how to add new users through MySQL database. Before that, we should look at why you are doing this.

Why add new user through MySQL database?

We admit that you are probably reading this because you cannot access the dashboard of your WordPress site and already understand why. In most cases, you won’t have physical access to any other part of WordPress, so you’ll have to “walk the long way” to get to your site.

As for why this happens, the first reason is user engagement. This can cover some innocent and malicious use cases:

You may have forgotten and/or lost your user credentials and have no other admin user to fall back on.

It may be that you are more comfortable in the interface of a MySQL database (although this may be rare).

You are the victim of a malicious attack that compromises your website.

You may also be battling a disgruntled former admin user exercising the ability to lock you out of your site.

Of course, many of these reasons are dramatic and extreme situations. Whatever the reason for your inaccessibility, you can take advantage of the accessibility of the MySQL database to create a new WordPress user.

How to Add WordPress New User via MySQL Database?

How to Access Your MySQL Database

Before setting up a new user, you need access to the database itself. If you’re brave enough, you can do this from the command line, but there’s a more direct way.

You can access your database through administrative tools like phpMyAdmin or Adminer. Depending on your landlord, you will find one of these. Few hosts don’t offer one of these, or even an alternative database management solution.

What to do if you suspect your site has been hacked

Before we go any further, it’s crucial to talk about hacked sites. If you suspect that your website has been hacked, you should act quickly. This is a topic we discuss elsewhere on the blog, but in a nutshell, you need to neutralize the threat before you do anything else.

If you are having trouble accessing a hacked website, our advice is to contact a professional company such as WP Tech Support, Sucuri, Wordfence or MalCare. They will be able to help you control the situation, which will give you the opportunity to support future sites.

How to Add New WordPress User via MySQL Database

Remember to take a full backup of your site and database before opening any database management tool of your choice. If the worst happens and you need to restore your website, these files will be the most valuable to you.

Once you’re ready, you need to perform the following steps:

Access your MySQL database with your favorite tool.

Open the wp_users table.

Insert the user into the table.

Add functionality for new users.

Recommended reading:

How to get rid of GB WhatsApp ban?

How is the recent social software Fouad WhatsApp different?

Leave a Reply

Your email address will not be published. Required fields are marked *