【发布时间】:2020-05-17 11:26:41
【问题描述】:
我在本地使用 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 的配置是正确的,但仍然无法连接。可能是我错过了一些简单的东西。
最好的问候,
苏拉夫
【问题讨论】:
-
你有mysql的命令行访问权限,可以重启mysql吗?
-
不起作用...通过管理器应用程序重新启动了 mysql...也无法通过 CLI 登录
-
那你需要重置root密码。
-
我重置了root密码并更新了phpmyadmin app的confic.inc.php中的密码。成功了