简体   繁体   English

意外锁定 phpmyadmin localhost

[英]Accidentally locked phpmyadmin localhost

In the process of trying to set up my database on phpmyadmin to have a password, I was locking things (stupidly) and accidentally locked the localhost access .在尝试为 phpmyadmin 上的数据库设置密码的过程中,我(愚蠢地)锁定了东西,不小心锁定了 localhost 访问权限

错误

I've tried:我试过了:

  • Changing the user, password, & port in MySQL config my.ini .在 MySQL 配置my.ini中更改用户、密码和端口。
  • Changing the user & password in PHPMyAdmin config config.inc.php & changing the port from 3306 -> 4306 .在 PHPMyAdmin 配置config.inc.php中更改用户和密码,并将端口从3306 -> 4306更改。
 /* Authentication type and info */ $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'USER'; $cfg['Servers'][$i]['password'] = 'PASS'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Servers'][$i]['port'] = 4306; $cfg['Lang'] = '';

Note: even when changing to $cfg['Servers'][$i]['AllowNoPassword'] = false;注意:即使更改为$cfg['Servers'][$i]['AllowNoPassword'] = false; it still doesn't work.它仍然不起作用。

Note #2: when changing to $cfg['Servers'][$i]['auth_type'] = 'cookie';注意 #2:更改为$cfg['Servers'][$i]['auth_type'] = 'cookie'; I get this error on the login page.我在登录页面上收到此错误

  • mysql -p -u root & mysql -p -u USER but get this error when entering the right credentials: mysql -p -u root & mysql -p -u USER但在输入正确的凭据时出现此错误:
 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
  • Looked at this thread but this still didn't work for me.看着这个线程,但这仍然对我不起作用。
  • Tried mysql stop but get this error (based on looking at this thread ):尝试mysql stop但出现此错误(基于查看此线程):
 ERROR 1045 (28000): Access denied for user 'MYNAME'@'localhost' (using password: NO)
  • It seems the only thread I could find with someone who's seemingly done the exact same thing as me is this one .似乎我能找到的唯一线索是这个似乎和我做过完全相同的事情的

So, I've come the conclusion there is something I need to do in order to unlock accessing phpmyadmin via localhost, but I have no idea what.所以,我得出结论,我需要做一些事情才能解锁通过本地主机访问 phpmyadmin,但我不知道是什么。 I don't think the problem is relating to an invalid password or username but instead just localhost being "locked".我不认为问题与无效密码或用户名有关,而只是本地主机被“锁定”。

How do I unlock it?我如何解锁它?

Try to bring down your mysql instance, followed by尝试关闭您的 mysql 实例,然后

mysqld_safe --skip-grant-tables

then make your changes, like changing the password or the access limitation.然后进行更改,例如更改密码或访问限制。
Example:例子:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';

After that, flush the privileges and restart mysql.之后,刷新权限并重新启动 mysql。

I just uninstalled and re-installed xampp and that did it.我刚刚卸载并重新安装了 xampp 并做到了。 Just have to re-set up my database只需要重新设置我的数据库

I faced the same issue , and I resolved it in the following way.我遇到了同样的问题,我通过以下方式解决了它。

I faced this issue on a XAMPP server, and I opened up the XAMPP server and restarted all of the services.我在 XAMPP 服务器上遇到了这个问题,我打开了 XAMPP 服务器并重新启动了所有服务。 Then stopped all of the services and started again.然后停止所有服务并重新启动。

That lock option in phpmyadmin is basically to lock users out for that particular session, which means whenever you restart, everything will reconfigure in case you locked yourself out. phpmyadmin 中的锁定选项基本上是将用户锁定在特定的 session 之外,这意味着无论何时重新启动,如果您将自己锁定在外,一切都会重新配置。

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

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