1

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

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
ghassan sy
  • 75
  • 1
  • 7

2 Answers2

4

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.

A.A Noman
  • 5,244
  • 9
  • 24
  • 46
0

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

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64