I'm running Wordpress and I'm impatient because I can't log in as an administrator. Password reset didn't work either, so I decided to change the password by operating mariadb directly.
If you are building on Kusanagi Rod, the mariadb password can be found in .kusanagi.mysql
.
bash:.kusanagi.mysql
MYSQL_ROOT_PASSWORD=wp_root_password <--This!
MYSQL_DATABASE=wp_database
MYSQL_USER=wp_username
MYSQL_PASSWORD=wp_password
MYSQL_CHARSET=utf8mb4
#MYSQL_ALLOW_EMPTY_PASSWORD=
#MYSQL_RANDOM_ROOT_PASSWORD=
#SOCKET=
#MYSQL_INITDB_SKIP_TZINFO=
#MYSQL_ROOT_HOST=
Log in to Docker mariadb with the docker command and then change your Wordpress password. The password is hashed with MD5 in the database, so change it using the MD5 command.
$ docker-compose exec db mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.5.6-MariaDB-1:10.5.6+maria~focal mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
MariaDB [(none)]> use wp_database;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [wp_database]>
MariaDB [wp_database]> select * from wp_users;
+----+------------+-----------+---------------+--------------+----------------------+---------------------+-----------------------------------------------+-------------+--------------+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+----+------------+-----------+---------------+--------------+----------------------+---------------------+-----------------------------------------------+-------------+--------------+
| 1 | admin | md5_password | admin | mail@ddress | http://example.com | 2020-08-05 05:53:54 | ???? | 0 | admin |
| 2 | user | md5_password | user | mail@ddress | | 2020-08-05 06:30:29 | ???? | 0 | ???? |
+----+------------+-----------+---------------+--------------+----------------------+---------------------+-----------------------------------------------+-------------+--------------+
2 rows in set (0.023 sec)
MariaDB [wp_database]>
MariaDB [wp_database]> update wp_users set user_pass=MD5('newpassword') where id=1;
Query OK, 1 row affected (0.034 sec)
Rows matched: 1 Changed: 1 Warnings: 0
It's OK if you can now log in to Wordpress.
Recommended Posts