在EasyPHP {WAMP}中设置根密码后,无法从phpMyAdmin访问MySQL

问题描述:

在成功启动MySQL后成功设置后,页面出于安全原因提示我设置ROOT密码.

After successful setup on initial launch of MySQL, the page prompted me to set up ROOT password for security reasons.

设置密码后,将无法再访问MySQL.错误是:

On setting the password, am no longer able to access MySQL. The error is:

1045 - Access denied for user 'root'@'localhost' (using password: NO) 

在网上查找并在phpmyadmin foler的config.inc.php中尝试了以下选项:

Looked up on the net and tried the following options in the config.inc.php from the phpmyadmin foler:

  1. 将身份验证设置为"http",以便提示输入用户名和密码

  1. Set the authentication to "http" so that it prompts to enter the username and password

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

  • 在配置文件中设置正确的密码

  • Set up the correct password in the config file

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

  • 他们都没有工作.

    有人可以建议一种解决方法来访问MySQL吗?不必为无法使用root帐户而大惊小怪,但想使用其他用户名对数据库进行CRUD.

    Can anyone suggest a workaround to access MySQL? Am not fussed about not being able to use the root account but would like to CRUD on the database using other username.

    这是我的phpmyadmin config.inc.php文件:

    here is my phpmyadmin config.inc.php file:

    <?php
    
    $i = 0;
    $i++;
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['extension'] = 'mysql';
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    
    ?>
    

    如果Apache/PHP与MySQL在同一台计算机上运行,​​那应该就足够了.然后将提示您输入用户名和密码.输入root和您设置的密码.

    That should be enough if Apache/PHP is running on the same machine as MySQL. Then you will be prompted for a username and password. Enter root and the password that you set.