简体   繁体   English

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

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

I've changed password of localhost user of my AMPPS stack and now I can not log into phpmyadmin It Shows a pink message : Access Denied... , I have tried restoring all default configuration but have the same problem. 我已经更改了我的AMPPS堆栈的localhost用户的密码,现在我无法登录到phpmyadmin它显示一条粉红色的消息: Access Denied... ,我已经尝试恢复所有默认配置但是有同样的问题。

I've checked config.inc file and it's content was : 我检查了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'] = '';

?>

This is my.conf file part that is related to the password : 这是与密码相关的my.conf文件部分:

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

I have checked mysql.ini file too and there was just one field like : 我也检查了mysql.ini文件,只有一个字段,如:

# PASSWORD = (your passwrod)

I removed # from the begining of that line and saved the file and I restarted Apache and mysql. 我从该行的开头删除了#并保存了文件,然后我重新启动了Apache和mysql。 I even quited the app and then reopend it but the problem was there and nothing changed. 我甚至退出了​​应用程序,然后重新打开它,但问题出现了,没有任何改变。

I've checked my codes to see if I'm able to use my codes with the new password and it was working but the only problem is I can not go to phpmyadmin anymore. 我已经检查了我的代码,看看我是否能够使用我的密码和新密码并且它正常工作,但唯一的问题是我不能再去phpmyadmin了。

I had the same issue and this solution worked for me : You can Reinstall It Again, Or if you don't want to lose anything just install it on another drive or disk and copy past configuration files. 我有同样的问题,这个解决方案对我有用:你可以重新安装它,或者如果你不想丢失任何东西,只需将它安装在另一个驱动器或磁盘上并复制过去的配置文件。 Remember If you want to change phpmyadmin password go to ampps app and from it's panel go to change mysql password from there you can change mysql and phpmyadmin password without any problem. 记住如果你想更改phpmyadmin密码请转到ampps app并从它的面板去更改mysql密码从那里你可以更改mysql和phpmyadmin密码没有任何问题。 the default password of mysql and phpmyadmin is 'mysql'. mysql和phpmyadmin的默认密码是'mysql'。

Hope solve your problem. 希望解决你的问题。

Really awkward. 真的很尴尬。 I ran into the same problem with Ampps on Windows when changing phpmyadmin to "no password". 当我将phpmyadmin更改为“无密码”时,我在Windows上遇到了与Ampps相同的问题。 Afterwards I could not login anymore. 之后我再也无法登录了。 Error message: 错误信息:

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. phpMyAdmin尝试连接到MySQL服务器,服务器拒绝连接。 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. 您应该检查配置中的主机,用户名和密码,并确保它们对应于MySQL服务器管理员提供的信息。

I just did a fresh installation to "solve" the issue. 我刚刚做了一个新的安装来“解决”这个问题。

Most of the " solutions " online suggest to change the /phpmyadmin/config.inc.php . 大多数在线“ 解决方案 ”建议更改/phpmyadmin/config.inc.php Using cookie instead of config showed at least the login screen. 使用cookie而不是config显示至少登录屏幕。 But still, login was not possible. 但仍然无法登录。

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

There must be a mismatch between the mysql settings (username / password) and the phpmyadmin settings (username "root", no-password). mysql设置(用户名/密码)和phpmyadmin设置(用户名“root”,无密码)之间必定存在不匹配。 And maybe some security settings. 也许一些安全设置。

It would be very helpful if someone finds another solution. 如果有人找到另一个解决方案,那将非常有帮助。

One that could work: MySql How to set root password to null 可以工作的一个: MySql如何将root密码设置为null

delete 删除

$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)';

and paste 并粘贴

$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';

in

/phpmyadmin/config.inc.php. /phpmyadmin/config.inc.php。

work for me - MAC OSX, make your login now. 为我工作 - MAC OSX,立即登录。

Okay after about 2-3 hours of insane headbashing, I've manage to make it work, however even if phpmyadmin work, it will still disappoint you. 好吧,经过大约2-3个小时的疯狂头颅,我已经设法让它工作,但即使phpmyadmin工作,它仍然会让你失望。 It has nothing to do with the installation, so you can reinstall it if you wish. 它与安装无关,因此您可以根据需要重新安装。 The first thing I did was checked my mysql error log and mac's Activity Monitor to make sure I have all mysql processes turned off: 我做的第一件事是检查我的mysql错误日志和mac的Activity Monitor,以确保我关闭了所有mysql进程:

killall -9 [processIDhere]

yet the mysqld process cannot be stopped, it simply changed to another process id. 但是mysqld进程无法停止,它只是改为另一个进程id。

So I tweaked the config.inc.php file a bit and made this change: 所以我稍微调整了config.inc.php文件并做了这个改动:

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

However, the password is still not working. 但是,密码仍然无效。

So then this does the trick: I went to mysql/etc/my.conf , on line 17-18 with the #password , I uncommented it and put 那么这就是诀窍:我使用#password转到mysql / etc / my.conf ,在第17-18行,我取消注释并放入

# 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)

Then I went back to localhost/phpmyadmin and use root as username, and mysql as my default password and was able to login. 然后我回到localhost / phpmyadmin并使用root作为用户名,并将mysql作为我的默认密码并且能够登录。

However, even if I am able to log in to phpmyadmin and create a table, there is an issue with establishing a connection to the a wordpress file I dropped in www/ for my manual configuration. 但是,即使我能够登录到phpmyadmin并创建一个表,也存在与我在www /手动配置中删除的wordpress文件建立连接的问题。 I learned that using Softaculous' WordPress installation creates a different mysql process and db that lives in ampps/var/ than the one on phpmyadmin. 我了解到使用Softaculous'WordPress安装创建了一个不同的 mysql进程和db,它位于ampps / var /中,而不是phpmyadmin上的。 I went to the terminal and login with this command to double check: 我去了终端并使用此命令登录以进行双重检查:

mysql -u root -p "mysql" and then use mysql -u root -p "mysql"然后使用

SHOW TABLES;

This does show that the databases from the phpmyadmin are there. 这确实表明phpmyadmin中的数据库存在。 This kind of destroys the point if you want to use Softaculous WordPress installer. 如果你想使用Softaculous WordPress安装程序,这种破坏点。 You would have to find another way to grab the mysql file. 你必须找到另一种方法来获取mysql文件。 I think the answer is in the mysql/etc/my.conf file, since the socket is set to this path: 我认为答案在mysql / etc / my.conf文件中,因为套接字设置为此路径:

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

I haven't play around with this yet, but I would assume tweaking this will redirect it to phpmyadmin socket instead of Softalicious service. 我还没有玩过这个,但我会假设这会将它重定向到phpmyadmin socket而不是Softalicious服务。 Would someone let me know if I am on the right track. 如果我走在正确的轨道上,有人会告诉我。 (the my.conf can also be found on clicking on the configuration button here: (点击这里的配置按钮也可以找到my.conf:

屏幕截图2017-01-12 at 6.24.18 PM.png

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM