0

I have tried to make a migration and it is not possible, the user entered has the necessary permissions and the password are also correct, but when executing the "php artisan migrate" command, I always get the same error.

I have already tried the following commands on my server :

sudo apt-get install php8.1-mysql

and it still doesn't work, also, the

.init

file, I have uncommented the following:

extension=pdo_mysql

and I also put:

extension=pdo_mysql.so

enter image description here

The configuration is (with the correct information) like that: enter image description here

I always get the same:enter image description here

   Illuminate\Database\QueryException 

  could not find driver (SQL: select * from information_schema.tables where table_schema = videoclub and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
    756▕         // If an exception occurs when attempting to run a query, we'll format the error
    757▕         // message to include the bindings with SQL, which will make this exception a
    758▕         // lot more helpful to the developer instead of just the database's errors.
    759▕         catch (Exception $e) {
  ➜ 760▕             throw new QueryException(
    761▕                 $query, $this->prepareBindings($bindings), $e
    762▕             );
    763▕         }
    764▕     }

      +36 vendor frames 
  37  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
Tushar
  • 3,527
  • 9
  • 27
  • 49
  • Is you checked your DB credentials like name, user, password? And did you restart the webserver after removing the semicolon in the line of code in `php.ini`? Also have you checked out this post: https://stackoverflow.com/questions/42557693/laravel-pdoexception-could-not-find-driver – cengsemihsahin Feb 07 '23 at 21:28
  • Check `config/database.php` and `.env`; make sure the values are what you expect. I often find opening `php artisan tinker` and doing `config('database')` to output the current database settings useful to identify mistakes. – ceejayoz Feb 07 '23 at 21:33
  • 2
    Does this answer your question? [Laravel: PDOException: could not find driver](https://stackoverflow.com/questions/42557693/laravel-pdoexception-could-not-find-driver) – cengsemihsahin Feb 07 '23 at 21:34

0 Answers0