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

前端 未结 23 3401
刺人心
刺人心 2020-11-30 01:39

This might seem redundant but I was unable to find a correct solution.

I was unable to login to mysql using the mysql console.It is asking for a password and I have

相关标签:
23条回答
  • 2020-11-30 02:18

    Well, there are many solutions already given above. If there are none of them works, maybe you should just try to reset your password again to 'root' as described here, and then reopen http://localhost/phpMyAdmin/ in other browser. At least this solution works for me.

    0 讨论(0)
  • 2020-11-30 02:18

    with MariaDb, above solutions doesn't works.

    Use (exemple below with ubuntu 16.04 and mariadb-server Distrib 10.0.28):

        sudo mysql_secure_installation
        …
        Change the root password? [Y/n] 
        New password: 
    
    0 讨论(0)
  • 2020-11-30 02:20

    Go to config.inc.php, find $cfg['Servers'][$i]['password'] and remove any password provided, i.e change $cfg['Servers'][$i]['password'] = 'password'; with $cfg['Servers'][$i]['password'] = '';

    Now you can launch phpMyAdmin

    Selecting Users menu from phpMyAdmin, select the root user and click Edit previlidges. Now scroll down to Change Password area, switch between No Password and Password to provide your new password. that's it.

    0 讨论(0)
  • 2020-11-30 02:20

    First you have to go config.inc.php file then change the following instruction

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

    or

    0 讨论(0)
  • 2020-11-30 02:20

    If you arrived here because you can't log into your phpMyAdmin, then try the root password from your Mysql instead of the password you put during phpMyAdmin installation.

    0 讨论(0)
  • 2020-11-30 02:20
    php artisan serve 
    

    this command get the env contents for the first time and if you update .env file need to restart it.

    in my case my username and dbname is valid and php artisan migrate worked

    but need to cntrl+c , to cancel php artisan serve , and run it again

    php artisan serve
    
    0 讨论(0)
提交回复
热议问题