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

时间:2015-02-16 12:20:23

标签: php mysql phpmyadmin 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;

请帮帮我..谢谢..

5 个答案:

答案 0 :(得分:5)

使用默认密码登录:

Username: root

Password: [null]

使用[null]我的意思是根本没有密码。

答案 1 :(得分:3)

只需安装" MySQL工作台"如果已经过期,它会要求新密码和新密码。

我的WAMP服务器遇到了同样的问题,并设法修复它。

答案 2 :(得分:1)

终于明白了。

我按照here描述的说明进行操作。按照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;

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

答案 3 :(得分:1)

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

body, html {
    height: 100%;
}

答案 4 :(得分:0)

WAMPServer使用了

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

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

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

注意:

如果您没有更改MySQL以在root帐户上设置密码,则将密码字段留空在登录屏幕上。

相关问题