Create a new wordpress admin user in the database

To create a new WordPress admin user in the database, you can use the following SQL query:

INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_url, user_registered, role_id)
VALUES ('new_admin_username', MD5('new_admin_password'), 'New Admin', '[email protected]', '', NOW(), 1);

Here's a breakdown of the columns and values:

Note: Make sure to replace new_admin_username, new_admin_password, and [email protected] with the desired values for your new admin user.

To execute this query, you can use a tool like phpMyAdmin or a SQL client like MySQL Workbench. Alternatively, you can use the WordPress wp_insert_user function in a PHP script to create the new user programmatically.

Here's an example of how you can use the wp_insert_user function:

<?php
$user_data = array(
    'user_login' => 'new_admin_username',
    'user_pass' => 'new_admin_password',
    'user_email' => '[email protected]',
    'role' => 'administrator'
);
wp_insert_user($user_data);
?>

This code creates a new user with the specified username, password, email address, and role, and inserts it into the wp_users table.