skip to Main Content

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


  1. 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
    
    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
  4. try this:

    1. composer du.
    2. php artisan make:migration create_model_table.
    3. php artisan migrate.

      you must be sure that you entered the right db credintials.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search