How to create or recover WordPress Admin user


#42
 docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES


#43

No wonder the wp-cli command didn’t work, none of your containers are up. Try ee service enable


#44
ee service enable
usage: ee service enable <service-name>


#45

Hi again, what happens when you just type in mysql in the terminal? You should see an error like this:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

If that shows up then it’s good news, you can export the DB.


#46

It Says

 mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8579
Server version: 10.1.38-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


#47

Nice, type in: show databases;


#48

Yes Its showing the databases:


MariaDB [(none)]> show databases;
+---------------------+
| Database            |
+---------------------+
| bulkaccountshop_com |
| information_schema  |
| mysql               |
| performance_schema  |
+---------------------+


#49

Ok exit out of mysql and then type this:

mysqldump -u username -p bulkaccountshop_com > ~/bulkaccountshop_com.sql

#50

Its comeleted but where is the file ?


#51

It’s in your user’s home directory /home/username


#52

It supposed to be under


root@cloud49:~# find ~/ -type f -name bulkaccountshop_com.sql
/root/bulkaccountshop_com.sql
root@cloud49:~#

BUt when I checked with file zilla there is nothing


#53

It’s right there. I didn’t realize you were running as root.


#54

It should be there but its not actually am installing zip


#55

Yes in zip it worked thank you mate…


#56

Output to root folder then

mysqldump -u username -p bulkaccountshop_com > /root/bulkaccountshop_com.sql

#57

Oh you got it, cool.


#58

Yes mate but thank you a lot for giving your time here


#59

No problem!


#60

You can create a new WordPress admin user from within the database. Use this method if your original admin user was

  1. Log into phpMyAdmin ([cPanel]

Note: If you’re using cPanel Hosting, you must select the database for your WordPress site in the left-hand column before proceeding to the next step

  1. Click the _users table
  2. Click the Insert tab
  3. Fill in the following fields.
  • ID is any number you choose
  • user_login is the username for accessing the WordPress Dashboard.
  • user_pass is the password for the user. Make sure to select MD5 in the functions menu
  • user_nicename is the nickname for the user
  • user_email is the email address you want to associate with this user
  • user_registered is the date and time for when this user is registered
  • user_status should be set to 0
  • display_name is the name that will be displayed for this user on your site
  1. Click the Go button
  2. Click the _usermeta table
  3. Click the Insert tab
  4. Fill in the following fields:
  • user_id is the ID you entered in the previous step
  • meta_key should be the phrase wp_capabilities
  • meta_value should be

a:1:{s:13:“administrator”;s:1:“1”;}
9. Click Go
10. Click the Insert tab again
11. Enter the following information:

  • user_id is the same number you entered in the previous step
  • meta_key should be the phrase wp_user_level
  • meta_value should be the number 10
  1. Click the Go button.

You can now login with the new Admin user.


#61

Or wp-cli one liner

wp user create bob bob@example.com --role=administrator