GoranStimac.com

How can I help

Stay informed and learn

Let's connect

How to enter a new password for WordPress using MySQL CLI on Linux?

See the name of the database used by WP. You can find the database name in the wp-config.php file or you can use the command

grep DB_NAME wp-config.php

We are interested in this line

define( 'DB_NAME', 'wpdatabase' );

Once we find out the name of the database we need to connect to it using the command

mysql -u root -p wpdatabase

Now we need to find the user using a command similar to this, customize as needed

SELECT ID, user_login, user_pass, user_email FROM wp_users;

when we find the user it is easiest to select it using the ID, most often the administrator ID is 1 because it is the first user-created, and the command to enter a new password is as follows

UPDATE wp_users SET user_pass = MD5('my-new-password-here') WHERE ID = 1;
quit;

That’s it, try logging in to WP administration.

Newer post

How to enable mod_rewrite in Apache server on Ubuntu/Debian Linux server?

Older post

How to install Odoo 14 system and set it to work via Nginx proxy?

comments powered by Disqus

Looking for an IT professional?

Book a call Email me