skip to Main Content

I’m trying to log-in to MySQL server with PHPMyAdmin but it does not work,

I insert true username and password but it still doesn’t work and I don’t know what’s the reason

error:

mysql_real_connect(): (HY000/1045):Access denied for user
‘root’@’localhost'(using password YES) Connection for control user as
defined in your configuration failed

can’t enter to PHPMyAdmin

2

Answers


  1. NEW Version of MYSQL does it this way.

    In the new my-sql if the password is left empty while installing then it is based on the auth_socket plugin.

    The correct way is to login to my-sql with sudo privilege.

    $ sudo mysql -u root -p
    

    Enter your database password and then updating the password using:

    $ ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-password';
    

    where new-password is your new database password or what you want

    Once this is done stop and start the mysql server.

    $  sudo service mysql stop
    $  sudo service mysql start
    

    Do comment for any doubt.

    Login or Signup to reply.
  2. After completion of any .env edit, must be clear cache: php artisan config:cache

    If you fixed everything and still have an error then stop XAMPP and restart Apache and MySQL server

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search