---
title: 'Resetting WordPress Admin Password via Console | Zomro'
description: 'If you have a Linux Ubuntu or CentOS 7 server hosting your WordPress website, you can reset the WordPress admin password via the console. This'
image: 'https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48%40server-panel.net/2023/04/03/image-20230403111959-2.jpg'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [FAQ](https://zomro.com/blog/faq/)
  * Resetting WordPress Admin Password via Console in Linux Ubuntu or CentOS 7 



# Resetting WordPress Admin Password via Console in Linux Ubuntu or CentOS 7

03-04-2023

If you have a Linux Ubuntu or CentOS 7 server hosting your WordPress website, you can reset the WordPress admin password via the console. This is especially useful if you do not have access to phpMyAdmin or if you prefer using the command line interface. In this article, we will walk you through the steps to reset the WordPress admin password via the console in Linux Ubuntu or CentOS 7.

**Step 1: Access the Console**

The first step is to access the console of your Linux Ubuntu or CentOS 7 server. You can do this via SSH by using a terminal application such as PuTTY.

**Step 2: Access the MySQL Database**

Once you have accessed the console, you need to access the MySQL database that your WordPress website is using. To do this, enter the following command:

> `mysql -u root -p`

![Resetting WordPress Admin Password via Console in Linux Ubuntu or CentOS 7 - 1](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48%40server-panel.net/2023/04/03/image-20230403111959-2.jpg)

This will prompt you to enter the MySQL root password. Enter the password and press Enter.

**Step 3: Select the WordPress Database**

After entering the MySQL root password, you need to select the WordPress database. To do this, enter the following command:

> show databases;

![Resetting WordPress Admin Password via Console in Linux Ubuntu or CentOS 7 - 2](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48%40server-panel.net/2023/04/03/image-20230403111943-1.jpg)

> `use wordpress_database;`

Replace "wordpress_database" with the name of your WordPress database. In my case **admin_kn_base.**

![Resetting WordPress Admin Password via Console in Linux Ubuntu or CentOS 7 - 3](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48%40server-panel.net/2023/04/03/image-20230403112129-3.jpg)

**Step 4: Update the Admin Password**

Once you have selected the WordPress database, you need to update the admin password. To do this, enter the following command:

`UPDATE `wp_users` SET `user_pass` = MD5( 'new_password' ) WHERE `wp_users`.`user_login` = "admin";`

![Resetting WordPress Admin Password via Console in Linux Ubuntu or CentOS 7 - 4](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48%40server-panel.net/2023/04/03/image-20230403114334-2.jpg)

Replace "new_password" with the new password you want to set and "admin" with the username of the admin account.

**Step 5: Exit MySQL**

After updating the admin password, you need to exit MySQL. To do this, enter the following command:

`exit;`

**Step 6: Test the New Password**

After resetting the admin password, log out of the console and try logging in to your WordPress dashboard using the new password. If you can successfully log in, you have successfully reset the password.

**Conclusion**

Resetting the WordPress admin password via the console in Linux Ubuntu or CentOS 7 is a quick and easy solution to regain access to your website. It is recommended to use a strong password and change it regularly to ensure the security of your website. Additionally, ensure that you keep your website and plugins updated to prevent vulnerabilities that may be exploited by hackers.

Similar articles:

[How to connect via SSH to CPanel virtual hosting using Putty?](https://zomro.com/blog/faq/193-kak-podkljuchitsja-po-ssh-k-virtualnomu-hostingu-cpanel-ispolzuja-putty) [How to see whois of a domain](https://zomro.com/blog/faq/395-how-to-see-whois-of-a-domain) [Configuring Firewall with Centos 7 IPTables](https://zomro.com/blog/faq/360-configuring-firewall-with-centos-7-iptables) [Creating Minecraft Java Servers.](https://zomro.com/blog/faq/325-creating-minecraft-java-servers) [How to enable previous session restore on Windows Server 2016, 2019?](https://zomro.com/blog/faq/311-kak-vkljuchit-vosstanovlenie-predyduschej-sessii-na-servere-windows-server-2016-2019)

[ Virtual hosting from €3.98/mon ](/virtual)
