Looks like you set wrong config in config/database.php file .
Check your config/database.php file with chosen connection and check driver value, or write it here.
Summer Sale! All accounts are 50% off this week.
Looks like you set wrong config in config/database.php file .
Check your config/database.php file with chosen connection and check driver value, or write it here.
Thanks @TheMY3 for your reply. Here is my congin/database.php file.
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'mylaravelvue'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', 'root'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
];
@afoysal what driver are you using in your .env?
Thanks @TheMY3 for your reply. Here is my .env file.
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:IvytBNFzkpRaLJ3O29/Z95HI5qnDmKx7YCoeNQiTnh4=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mylaravelvue
DB_USERNAME=root
DB_PASSWORD=root
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
@afoysal Did you install PHP with mysql support?
Thanks @kobear for your reply. I am using Linux Mint. I installed MySql using this command
sudo apt-get install mysql-server php7.0-mysql phpmyadmin
Thanks
Did you enable php_mysqli in the php.ini file?
Look for this line in php.ini file and make sure it is uncommented
extension=php_mysqli.so
Thanks @kobear for your help. There is no extension=php_mysqli.so line in my php.ini file. I found extension=php_mysqli.dll in my php.ini file and uncomment it. Restart server and run php artisan db:seed and got same result as before.
can you please post the output of the following command?
php -m | grep mysql
Thanks @kobear . Here is the output
@afoysal MySQL support did not get installed with PHP.
Try running the following command
sudo apt-get install php-mysql
Then restart apache and try again.
@kobear , I ran your command but everything as before. Thanks
What is the output of the following command
php -m
@mcangueiro , here is the output of php -m. Thanks
What is the output of running the php-mysql install command?
Assuming you are running on PHP 7.1 you could try installing mysql with this command
sudo apt-get install php7.1-mysql
@mcangueiro Works for me as well but i adjusted to latest php version sudo apt-get install php8.1-mysql
Thanks @mcangueiro. Your solution is working. Thanks.
Using Laravel V 5.5.39 with Php 7.1.12 is working fine, but later (newer) php versions causes the problem. So, change Php version and you will get the solution 100% .
Please or to participate in this conversation.
