Unable to access MySQL from phpMyAdmin after setting root password in EasyPHP{WAMP}

↘锁芯ラ 提交于 2019-12-03 22:55:59

问题


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

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

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

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

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

    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'http';
    
  2. Set up the correct password in the config file

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

None of them worked.

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.


回答1:


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;

?>

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.



来源:https://stackoverflow.com/questions/2540794/unable-to-access-mysql-from-phpmyadmin-after-setting-root-password-in-easyphpwa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!