Access Denied for User 'Homestead'@'Localhost' (Using Password: Yes)

Access denied for user 'homestead'@'localhost' (using password: YES)

Check MySQL UNIX Socket

Find unix_socket location using MySQL

mysql -u homestead -p

mysql> show variables like '%sock%';
+-----------------------------------------+-----------------------------+
| Variable_name | Value |
+-----------------------------------------+-----------------------------+
| performance_schema_max_socket_classes | 10 |
| performance_schema_max_socket_instances | 322 |
| socket | /var/run/mysqld/mysqld.sock |
+-----------------------------------------+-----------------------------+
3 rows in set (0.00 sec)

Then I go to config/database.php

I update this line : 'unix_socket' => '/tmp/mysql.sock',

to : 'unix_socket' => '/var/run/mysqld/mysqld.sock',

That's it. It works for my as my 4th try.I hope these steps help someone. :D

Can't fix access denied for user homestead in laravel

Please be sure that you have homestead db in your phpmyadmin. If don't, please create a new one. And than, go to .env file (this is the default of mysql) fill your username database with root, and the password is (empty). I had a same problem with you about 1 or 2 months ago. I just created a new one db because I have no homestead db in my phpmyadmin. I hope this helps.

Getting error Access denied for user 'homestead'@'localhost' in PHP-LARAVEL

Do you have a .env file? If so, you have to edit the following values:

DB_HOST=127.0.0.1          //where your database hosted
DB_DATABASE=databasename //this database has to be created manually
DB_USERNAME=username //the username used to access your databases
DB_PASSWORD=password //the password

If you are running it on a vagrantbox, the username & password is usually root & vagrant by default



Related Topics



Leave a reply



Submit