Home Website TutorialsWordPress Quickly create WordPress Admin account on phpMyadmin

Quickly create WordPress Admin account on phpMyadmin

by Thạch Phạm
Published: Last Updated on

Surely many users have had the ironic problem that their website one day was attacked by a hacker or infected with malicious code and deleted all WordPress admin account information, or it could be the user themself accidentally deleted this information. So, what should you do if you accidentally fall into one of the above situations and cannot log in to the website administration page anymore? Don’t worry, you can refer to this article to learn how to solve it.

Step 1: Access phpMyadmin on your Hosting/VPS

image 154

Step 2: Copy and paste the account creation code

At phpMyadmin, you choose the correct database of the website (1) => select SQL (2).

image 155

Copy the code below and paste it into Run SQL query/queries on database.

INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('admin', MD5('password'), 'your name', 'admin@abc.xyz', '0');

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');

INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');

In the above code, you need to replace some places with your information as follows:

  • admin: replace with a new user to create
  • password: replace the new password to create
  • your name: replace with your Username
  • admin@abc.xyz: replace with your admin email information

Note: The above code uses default WordPress information, so the tables in the database will bewp_ . You need to check the database prefix on your website and replace it correctly according to the instructions below.

image 156

So my prefix is wp1m_ => in the above code, if there is wp_ in the above code, I will replace it with wp1m_. And specifically as below:

admin1 1

After entering all the information, click Go running the command.

Run the command successfully, you will get the information:

admin2 1

Now you access the website admin and try to login with the information you just created, I’ve done it successfully.



After completing the above steps, if you still cannot log in to the website administrator, you need to download the wp-reset-user.php file and upload it to the folder containing the website source code. Then you access yourdomain/wp-reset-user.php so that the website automatically updates user permissions. The screen shows below the completion of the update. Now please check if you have successfully logged in.



Thus, AZDIGI has shown you a way to create an admin account manually through phpMyadmin, this will help you in creating a new admin account. If you find this helpful article, please share it widely.

Wishing you success!

If you need assistance, you can contact support in the ways below:

  • Hotline 247: 028 888 24768 (Ext 0)
  • Ticket/Email: You can use your email to register for the service and send it directly to: support@azdigi.com
Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign