更改权限用户名和密码后无法访问phpMyAdmin(ERROR1405)


Cant access phpMyAdmin after changing the privileges username and password (ERROR1405)

在更改权限后,我似乎无法返回phpMyAdmin,我不断收到以下错误:

错误1405

MySQL表示:文档

1045-用户"根"的访问被拒绝™'@'localhost’(使用密码:YES)

我在mac上使用XAMPP。不确定如何解决这个问题,有什么想法吗?

您必须转到C:'xampp'phpMyAdmin'config.inc.php并编辑文件。默认文件(未设置任何密码)如下所示。

<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
/*
 * Servers configuration
 */
$i = 0;
/*
 * First server
 */
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
  • 如果您记得密码,则可以直接在密码字段中输入
  • 如果您不记得设置过任何密码,并且它仍然显示一些值,则将其更改为"(空字符串)
  • 如果不起作用,则以管理员身份打开命令行界面并键入sc delete mysql。这将删除您在mysql中所做的先前设置
  • 现在重新启动xammp服务器并打开phpMyAdmin