salvador98's avatar

could not find driver

hi . After uploading my site to the server, the site was working. But after a few days, the following error occurred

Illuminate \ Database \ QueryException could not find driver (SQL: select * from visits)

my env file:

DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_PORT=3306

DB_DATABASE=dbname DB_USERNAME=dbuser DB_PASSWORD=password

and in phpinfo()

PDO support => enabled

PDO drivers => pgsql, odbc, sqlite

PDO Driver for PostgreSQL =>enabled

PDO Driver for SQLite 3.x => enabled

PostgreSQL Support => enabled

Can you help me fix this problem؟

0 likes
3 replies
jlrdw's avatar

What driver? Most cpanels have an area where you can check mark the drivers and extensions you need.

Furthermore, what did the Host tech support have to say.

jlrdw's avatar

Show image here, I don't like clicking links.

Cronix's avatar
Cronix
Best Answer
Level 67

You're using the mysql driver

DB_CONNECTION=mysql

But you don't have the mysql pdo driver installed/enabled, or mysql would show up here

PDO drivers => pgsql, odbc, sqlite

You need to install/enable pdo_mysql. For instance, mine shows

PDO drivers => mysql, pgsql, sqlite 
2 likes

Please or to participate in this conversation.