#1045无法在wamp中登录MySQL服务器


#1045 Cannot log in to the MySQL server in wamp

我在服务器和本地机器中都安装了wamp。在本地机器中,这运行良好。但服务器中出现了一些问题。当我登录到phpmyadmin#1045无法登录到MySQL服务器错误显示。我该怎么解决这个问题?

我的config.inc.php文件包含以下代码

/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'admin';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

请帮帮我谢谢。。

使用默认密码登录:

Username: root
Password: [null]

我指的是根本没有密码。

只需安装"MySQL工作台",如果已经过期,它就会询问新旧密码。

我的WAMP服务器也遇到了同样的问题,并设法解决了它。

终于拿到了。

我按照这里描述的说明进行操作。按照4个步骤进行尝试。并且奏效了。

现在config.inc.php看起来像这个

/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

这与教程中描述的相同。因此,请按照链接中给出的所有步骤重新启动服务。会工作的。谢谢

删除您的密码并将其设置为null作为

$cfg['Servers'][$i]['password'] = 'null';

WAMPServer已使用

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';

很长一段时间以来,为了让phpMyAdmin抛出一个登录页面。这比在配置文件中存储userpassword要安全得多,配置文件允许任何人在没有经验的用户决定打开路由器以便向其他人显示他们的网站时登录phpMyAdmin。

因此,如上所述更改phpMyAdmins config.inc.php,并在登录屏幕上输入用户名和密码。

注:

如果您没有将MySQL更改为在根帐户上有密码,则在登录屏幕上将密码字段留空