我在本地使用 bitnami 的 wordpress 堆栈。
我一年前就安装了它。
现在,当我尝试登录 wp_admin 时,我不记得用户名/密码了。
我也无法连接到 phpmyadmin 来查看用户名/密码集。
我收到以下错误
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
下面是我的 config.inc.php 的 phpmyadmin 用户名/密码设置的相关部分
/**
* Authentication method (valid choices: config, http, signon or cookie)
*
* @global string $cfg['Servers'][$i]['auth_type']
*/
$cfg['Servers'][$i]['auth_type'] = 'config';
/**
* HTTP Basic Auth Realm name to display (only used with 'HTTP' auth_type)
*
* @global string $cfg['Servers'][$i]['auth_http_realm']
*/
$cfg['Servers'][$i]['auth_http_realm'] = '';
/**
* MySQL user
*
* @global string $cfg['Servers'][$i]['user']
*/
$cfg['Servers'][$i]['user'] = 'root';
/**
* MySQL password (only needed with 'config' auth_type)
*
* @global string $cfg['Servers'][$i]['password']
*/
$cfg['Servers'][$i]['password'] = '';
/**
* whether to allow root login
*
* @global boolean $cfg['Servers'][$i]['AllowRoot']
*/
$cfg['Servers'][$i]['AllowRoot'] = true;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
下面是我的mysql的my.cnf
[mysqladmin]
user=root
[mysqld]
basedir=/Applications/wordpress-4.9.4-4/mysql
datadir="/Applications/wordpress-4.9.4-4/mysql/data"
port=3306
socket=/Applications/wordpress-4.9.4-4/mysql/tmp/mysql.sock
tmpdir=/Applications/wordpress-4.9.4-4/mysql/tmp
max_allowed_packet=32M
bind-address=127.0.0.1
skip-name-resolve=1
character-set-server=UTF8
collation-server=utf8_general_ci
[client]
port=3306
socket=/Applications/wordpress-4.9.4-4/mysql/tmp/mysql.sock
default-character-set=UTF8
[manager]
port=3306
socket=/Applications/wordpress-4.9.4-4/mysql/tmp/mysql.sock
pid-file=/Applications/wordpress-4.9.4-4/mysql/tmp/manager.pid
default-mysqld-path=/Applications/wordpress-4.9.4-4/mysql/bin/mysqld.bin
我可以看到 phpmyadmin 中连接 mysql 的配置是正确的,但仍然无法连接。也许我错过了一些简单的事情。
最诚挚的问候,
索拉夫
最佳答案
只是回答如果您无法登录 Bitnami Wordpress 堆栈的 wp_admin 区域如何解决一般问题。另外,如果忘记 mysql 密码,情况会变得复杂。
首先使用此链接重置 root 密码
https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
更新phpmyadmin的配置文件config.inc.php中的密码
然后登录phpmyadmin并按照步骤更改wp_admin的用户密码。
https://www.fixrunner.com/cannot-login-wordpress-admin-area/
关于mysql - Bitnami Wordpress phpmyadmin 无法连接到 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60009881/