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
Create Programmatically a Variable Product and Two New Attributes in Woocommerce
PHP Send Mail to Multiple Email Addresses
How to Sum N Number of Time (Hh:Mm Format)
How to Override Trait Function and Call It from the Overridden Function
PHP Add Elements to Multidimensional Array with Array_Push
Php: Possible to Automatically Get All Posted Data
Setcookie, Cannot Modify Header Information - Headers Already Sent
How to Get the Os on Which PHP Is Running
Regex Pattern to Get the Youtube Video Id from Any Youtube Url
How to Select Randomly with Doctrine
PHP Exec $Path Variable Missing Elements
Traits in PHP - Any Real World Examples/Best Practices
Email from PHP Has Broken Subject Header Encoding