使用 AMPP 在 mac 上更改了 phpmyadmin 密码,现在无法登录 phpmyadmin

Changed phpmyadmin password on mac using AMPPs and now Can not login into phpmyadmin

我已经更改了我的 AMPPS 堆栈的本地主机用户的密码,现在我无法登录到 phpmyadmin 它显示一条粉红色消息:Access Denied...,我尝试恢复所有默认配置但遇到同样的问题。

我检查了 config.inc 文件,它的内容是:

<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = file_get_contents('/Applications/AMPPS/ampps/data/my.conf');
$cfg['Servers'][$i]['hide_db'] = '(information_schema|performance_schema)';

/* End of servers configuration */

$cfg['DefaultLang'] = 'en-utf-8';
$cfg['blowfish_secret'] = '';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>

这是与密码相关的 my.conf 文件部分:

# The following options will be passed to all MySQL clients
[client]
#password   = your_password
port        = 3306
socket      = {$path}/var/mysql.sock

我也检查了 mysql.ini 文件,只有一个字段:

# PASSWORD = (your passwrod)

我从该行的开头删除了 # 并保存了文件,然后重新启动了 Apache 和 mysql。我什至退出了应用程序,然后重新打开它,但问题仍然存在,没有任何改变。

我已经检查了我的代码,看看我是否可以使用我的代码和新密码,它是有效的,但唯一的问题是我不能再去 phpmyadmin。

我有同样的问题,这个解决方案对我有用:你可以重新安装它,或者如果你不想丢失任何东西,只需将它安装在另一个驱动器或磁盘上并复制过去的配置文件。 请记住,如果您想更改 phpmyadmin 密码,请转到 ampps 应用程序,然后从它的面板转到更改 mysql 密码,您可以毫无问题地更改 mysql 和 phpmyadmin 密码。 mysql 和 phpmyadmin 的默认密码是 'mysql'.

希望能解决你的问题。

真别扭。当将 phpmyadmin 更改为 "no password" 时,我 运行 在 Windows 上遇到了与 Ampps 相同的问题。之后我无法登录了。错误信息:

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.

我刚刚对 "solve" 问题进行了全新安装。

网上大部分“solutions”建议改成/phpmyadmin/config.inc.php。使用 cookie 而不是 config 至少显示了登录屏幕。但是,仍然无法登录。

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = false;

mysql 设置(用户名/密码)和 phpmyadmin 设置(用户名 "root",无密码)之间肯定不匹配。也许还有一些安全设置。

如果有人找到其他解决方案,那将非常有帮助。

一个可行的:MySql How to set root password to null

好的,经过大约 2-3 小时的疯狂抨击,我设法让它工作,但是即使 phpmyadmin 工作,它仍然会让你失望。它与安装无关,因此您可以根据需要重新安装它。我做的第一件事是检查我的 mysql 错误日志和 mac 的 Activity 监视器以确保我已关闭所有 mysql 进程:

killall -9 [processIDhere]

然而 mysqld 进程无法停止,它只是更改为另一个进程 ID。

所以我稍微调整了 config.inc.php 文件并做了以下更改:

之前:$cfg['Servers'][$i]['auth_type'] = 'config';
之后:$cfg['Servers'][$i]['auth_type'] = 'http';

然而,密码仍然无效。

那么这就是诀窍:我在第 17-18 行使用#password 转到 mysql/etc/my.conf, 我取消注释并放置

# The following options will be passed to all MySQL clients [client] password = mysql (NOTE: if you changed the password, you need to input the updated pw here)

然后我回到localhost/phpmyadmin并使用root作为用户名,mysql作为我的默认用户名密码并能够登录。

但是,即使我能够登录到 phpmyadmin 并创建一个 table,与我在 www/ 中放置的 wordpress 文件建立连接以进行手动配置时仍然存在问题。我了解到使用 Softaculous 的 WordPress 安装会创建一个 不同的 mysql 进程和位于 ampps/var/ 中的数据库,而不是 phpmyadmin 中的进程和数据库。我去了终端并使用此命令登录以仔细检查:

mysql -u root -p "mysql" 然后使用

SHOW TABLES;

这确实表明来自 phpmyadmin 的数据库在那里。如果您想使用 Softaculous WordPress 安装程序,这种做法会破坏要点。您将不得不找到另一种获取 mysql 文件的方法。我认为答案在 mysql/etc/my.conf 文件中,因为套接字设置为此路径:

socket = /Applications/AMPPS/var/mysql.sock

我还没有玩过这个,但我假设调整它会将它重定向到 phpmyadmin 套接字而不是 Softalicious 服务。如果我在正确的轨道上,有人会告诉我吗? (my.conf 也可以通过单击此处的配置按钮找到:

Screen Shot 2017-01-12 at 6.24.18 PM.png

删除

$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'coockie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = file_get_contents('/Applications/AMPPS/ampps/data/my.conf');
$cfg['Servers'][$i]['hide_db'] = '(information_schema|performance_schema)';

并粘贴

$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';

/phpmyadmin/config.inc.php.

为我工作 - MAC OSX,立即登录。