Reputation: 61
I am new with laravel and I want to migrate the table first I change .env information (database name, password,user name)and I made the model and write the proprieties but when I write the command php artisan migrate the tables did not appear in my phpmyadmin database and the following error appears:
SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'forge'
(SQL: select * from information_schema.tables where table_schema = forge and
table_name = migrations and table_type = 'BASE TABLE') catch (Exception $e) {
> 664| throw new QueryException( 665| $query, $this->prepareBindings($bindings),
$e 666| ); 667| } ...
Upvotes: 1
Views: 2053
Reputation: 21
try this:
Upvotes: 1
Reputation: 135
Make sure you create a blank database before running the migration.
I suggest you create new user and password in your sql and
GRANT ALL on <'name_of_your_database'>
Then update your .env file same as your database user credentials and migrate it.
Upvotes: 2
Reputation: 1353
If you run your project by php artisan serve
turn it off and run it again.
If not you need to check your credentials to your mysql
Upvotes: 0
Reputation: 584
Make sure you are running command in desire project. Have you created migration file for your model by
php artisan make:migration create_model_name
Update the column in migration file and then run
php artisan migrate
Upvotes: 0