I'm following the Hands-On project for course Laravel Essentails on Tutsplus. I created an app on PagodaBox and cloned it into my local system. After that, I install Laravel-4-Generator from https://github.com/JeffreyWay/Laravel-4-Generators and generated resources for my project: model, view, controller, database seed, etc. Next, I try to run
php artisan migrate:install snippets
But I got the following error:
[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
I don't know what's homestead user here. Here is my database file for this project
'default' => 'mysql',
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),
'mysql' => array(
'driver' => 'mysql',
'host' => isset($_SERVER['DB1_HOST']) ? $_SERVER['DB1_HOST'] : 'localhost',
'database' => isset($_SERVER['DB1_NAME']) ? $_SERVER['DB1_NAME'] : 'snippets',
'username' => isset($_SERVER['DB1_USER']) ? $_SERVER['DB1_USER'] : 'root',
'password' => isset($_SERVER['DB1_PASS']) ? $_SERVER['DB1_PASS'] : '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
And here is the result when I check grants for 'homestead'@'localhost':
mysql> SHOW GRANTS FOR 'homestead'@'localhost';
+---------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for homestead@localhost |
+---------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'homestead'@'localhost' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8.......F' WITH GRANT OPTION |
+---------------------------------------------------------------------------------------------------------------------------------------------+
P/S: I have created the snippets database in mysql and I'm an Ubuntu 14.04 machine. Has anyone experienced this before. What should I do as I don't understand what the error is here.
View Users created:
mysql> select user,host from mysql.user;
+------+----------------------+
| user | host |
+------+----------------------+
| root | % |
| root | 127.0.0.1 |
| root | ::1 |
| root | imac.de.yadira.local |
| | localhost |
| root | localhost |
| | mor-mac.local |
+------+----------------------+
7 rows in set (0.00 sec)
copy imac.de.yadira.local and replace hostname in my case it was mor-mac.local
$env = $app->detectEnvironment(array(
'local' => array('imac.de.yadira.local'),
));
and now runs:
mor-mac:resposive yadira$ php artisan migrate:install
Migration table created successfully.