#1045 Cannot log in to the MySQL server in wamp

22,692

Solution 1

Finally got it.

I followed the instructions just described as here. Follow the 4 steps and tried. And worked.

Now the config.inc.php is looks like this

/* 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;

This is same as described in the tutorial. So follow the all steps given in the link and restart the services. Will get worked. Thanks..

Solution 2

Log in using the default password:

Username: root

Password: [null]

With [null] I mean no password at all.

Solution 3

Just install "MySQL workbench" and it will ask for old and new passwords if already expired.

I had the same issue with my WAMP server and managed to fix it.

Solution 4

Remove your password and set it to null as

$cfg['Servers'][$i]['password'] = 'null';
Share:
22,692
Deepu Sasidharan
Author by

Deepu Sasidharan

Updated on June 16, 2020

Comments

  • Deepu Sasidharan
    Deepu Sasidharan almost 4 years

    I am installed wamp both in server and in my local machine. In local machine this is working fine. But some issues happened in server. While I log in to the phpmyadmin #1045 Cannot log in to the MySQL server error shows. How I can solve this?

    My config.inc.php file contain the following code

    /* 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;
    

    Please help me.. Thanks..