InsiderPhD / Generic-University

Vulnerable API
381 stars 101 forks source link

Illuminate\Database\QueryException #7

Closed Ashis101 closed 4 years ago

Ashis101 commented 4 years ago

Illuminate\Database\QueryException

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:672 668| // If an exception occurs when attempting to run a query, we'll format the error 669| // message to include the bindings with SQL, which will make this exception a 670| // lot more helpful to the developer instead of just the database's errors. 671| catch (Exception $e) {

672| throw new QueryException( 673| $query, $this->prepareBindings($bindings), $e 674| ); 675| } 676|

  +39 vendor frames 

40 artisan:37 Illuminate\Foundation\Console\Kernel::handle()

InsiderPhD commented 4 years ago

Have you updated the .env file with your database connection details? Including making a database?

Ashis101 commented 4 years ago

yes i update .env file:-

APP_NAME=Laravel APP_ENV=local APP_KEY=base64:BzD74IgPo/01lEYRNciBcagpIe4lJz2HRjVFnrbBlfo= APP_DEBUG=true APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=root

BROADCAST_DRIVER=log CACHE_DRIVER=file QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379

Ashis101 commented 4 years ago

and DB_PASSWORD= .

That also gave me that error.

InsiderPhD commented 4 years ago
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root

Is your password/username combo actually root/root? This is an error you get if your password doesn't work for your database