MySQL 如何找回丢失的 phpMyAdmin 密码,XAMPP
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16511444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get back Lost phpMyAdmin Password, XAMPP
提问by Ben Pearce
I have a local host running on XAMPP on a Mac. At some point I set a password in phpMyAdmin which I've ow forgotten. Can anyone help me get back into phpMyAdmin? I've followed a ton of tutorials but they all either don't work or refer to some file that doesn't seem to be on my computer. Is there an easy way?
我有一台在 Mac 上运行 XAMPP 的本地主机。在某些时候,我在 phpMyAdmin 中设置了一个密码,但我已经忘记了。任何人都可以帮助我回到 phpMyAdmin 吗?我已经学习了大量教程,但它们要么不起作用,要么引用了一些似乎不在我的计算机上的文件。有没有简单的方法?
When I try to open:
当我尝试打开时:
http://localhost
I get:
我得到:
The Server http://localhost:80 requires a username and password
采纳答案by MykolaSenechyn
Reinstalling the software fixes the issue, just make sure not to delete the htdocs folder in the process.
重新安装软件可以解决问题,只需确保不要在此过程中删除 htdocs 文件夹。
回答by Ricardo Parker
You want to edit this file: "\xampp\phpMyAdmin\config.inc.php"
你想编辑这个文件:“\xampp\phpMyAdmin\config.inc.php”
change this line:
改变这一行:
$cfg['Servers'][$i]['password'] = 'WhateverPassword';
to whatever your password is. If you don't remember your password, then run this command in the Shell:
无论您的密码是什么。如果您不记得密码,请在 Shell 中运行以下命令:
mysqladmin.exe -u root password WhateverPassword
where 'WhateverPassword' is your new password.
其中“WhateverPassword”是您的新密码。
回答by Nedshed
There is a batch file called resetroot.bat
located in the xammp folders 'C:\xampp\mysql' run this and it will delete the phpmyadmin
passwords. Then all you need to do is start the MySQL
service in xamp
and click the admin button.
有一个resetroot.bat
位于 xammp 文件夹“C:\xampp\mysql”中的批处理文件运行它,它将删除phpmyadmin
密码。然后您需要做的就是启动MySQL
服务xamp
并单击管理按钮。
回答by vlev
The question may be getting old, but I've struggled with the same issue just now.
这个问题可能已经过时了,但我刚才一直在努力解决同样的问题。
After deleting passwords with resetroot.bat
, as instructed by Nedshed, you can choose another password by going to http://localhost/security/index.php
使用 删除密码后resetroot.bat
,按照Nedshed 的指示,您可以通过转到选择另一个密码http://localhost/security/index.php
回答by T.Todua
The only solution worked for me:
唯一的解决方案对我有用:
(source: https://stackoverflow.com/a/22784404/2377343)
(来源:https: //stackoverflow.com/a/22784404/2377343)
You need to stop Mysql and change user password using Commands.
您需要停止 Mysql 并使用命令更改用户密码。
回答by user3766918
Hi this worked for me "/opt/lampp/xampp security" in Centos
嗨,这对我在 Centos 中的“/opt/lampp/xampp security”有用
[root@XXXXX ~]# /opt/lampp/xampp security
[root@XXXXX ~]# /opt/lampp/xampp 安全
XAMPP: Quick security check...
XAMPP:快速安全检查...
XAMPP: Your XAMPP pages are secured by a password.
XAMPP:您的 XAMPP 页面受密码保护。
XAMPP: Do you want to change the password anyway? [no] yes
XAMPP:您还是要更改密码吗?[否] 是的
XAMPP: Password:
XAMPP: 密码:
XAMPP: Password (again):
XAMPP:密码(再次):
XAMPP: Password protection active. Please use 'xampp' as user name!
XAMPP:密码保护激活。请使用“xampp”作为用户名!
XAMPP: MySQL is not accessable via network. Good.
XAMPP:无法通过网络访问 MySQL。好的。
XAMPP: MySQL has a root passwort set. Fine! :)
XAMPP:MySQL 设置了根密码。美好的!:)
XAMPP: The FTP password for user 'daemon' is still set to 'xampp'.
XAMPP:用户“daemon”的 FTP 密码仍设置为“xampp”。
XAMPP: Do you want to change the password? [yes]
XAMPP:您要更改密码吗?[是的]
XAMPP: Password:
XAMPP: 密码:
XAMPP: Password (again):
XAMPP:密码(再次):
XAMPP: Reload ProFTPD...ok.
XAMPP:重新加载 ProFTPD...好的。
XAMPP: Done.
XAMPP:完成。
[root@XXXXX ~]#
[root@XXXXX ~]#
回答by Ghazanfar Ali Danish
The best thing is to go to your phpmyadmin folder and open config.inc.php and change allownopassword=false to $cfg['Servers'][$i]['AllowNoPassword'] = true;
最好的办法是转到您的 phpmyadmin 文件夹并打开 config.inc.php 并将 allownopassword=false 更改为$cfg['Servers'][$i]['AllowNoPassword'] = true;
回答by MykolaSenechyn
Unless you have changed your password the default setting dont require you to enter a password to connect to the MYSQL server, try:
除非您更改了密码,否则默认设置不需要您输入密码来连接到 MYSQL 服务器,请尝试:
mysql_connect('localhost','root','');
mysql_connect('localhost','root','');
if not then you can export your databases to a external file, just follow these instructions.
如果没有,那么您可以将数据库导出到外部文件,只需按照这些说明操作即可。
http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html
http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html
if you are unable to access phpMyAdmin then try,
如果您无法访问 phpMyAdmin,请尝试,
http://www.simplehelp.net/2008/11/26/how-to-reset-a-lost-mysql-root-password/
http://www.simplehelp.net/2008/11/26/how-to-reset-a-lost-mysql-root-password/