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| } ...
4
Answers
Make sure you are running command in desire project.
Have you created migration file for your model by
Update the column in migration file and then run
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
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.
try this:
you must be sure that you entered the right db credintials.