Home > Net >  SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where

Time:12-13

I am trying to migrate the tables in "phpMyAdmin" by using this command php artisan migrate and getting this error.

Illuminate\Database\QueryException  : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = home and table_name = migrations)

  at /Users/bilalshahid/Desktop/laravel/officeProject/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668| 

  Exception trace:

  1   Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[HY000] [2002] No such file or directory")
      /Users/bilalshahid/Desktop/laravel/officeProject/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18

  2   Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
      /Users/bilalshahid/Desktop/laravel/officeProject/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:44

  Please use the argument -v to see more details.

I am using Xampp to run the server and the .env file has the following information:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=home
DB_USERNAME=root
DB_PASSWORD=root
DB_STRICT=false
DB_SOCKET=

Kindly guide me on how I could sort out this error.

CodePudding user response:

First, check all migration files. After that, if the problem does not solve then try with a new database name.

CodePudding user response:

The table does not exist. Create a fresh migration and check out the table names

  • Related