mysql - Bitnami Wordpress phpmyadmin 无法连接到 mysql

标签 mysql wordpress bitnami

我在本地使用 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 密码,情况会变得复杂。

  1. 首先使用此链接重置 root 密码

    https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html

  2. 更新phpmyadmin的配置文件config.inc.php中的密码

  3. 然后登录phpmyadmin并按照步骤更改wp_admin的用户密码。

    https://www.fixrunner.com/cannot-login-wordpress-admin-area/

关于mysql - Bitnami Wordpress phpmyadmin 无法连接到 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60009881/

相关文章:

php - while 从表单中循环 $_post

amazon-web-services - AWS Bitnami 在 Ec2 上启用 https

python - Django 使用一个 python session 响应来自不同浏览器的不同请求

mysql - 在 MySQL 中记录触发器生成的查询

php - DB : Table row with Onclick Modal with a row 中的 Foreach 条目

php - 长图像名称破坏 CSS div

php - wordpress/woocommerce : Remove price if zero

css - 坚持使用 Wordpress 菜单(可能需要自定义 CSS Walker)

apache - 如何使用带有 Bitnami LAMP Stack 的 mozilla 执行脚本 Perl?

php - 搜索表whitin字符串php