dipta_dey's avatar

Could not find driver (Connection: mysql, SQL: select * from `table`)

In live server it show this error . what will the solution ?

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

This error usually occurs when the PHP MySQL driver is not installed or enabled on the server.

To solve this issue, you can try the following steps:

  1. Check if the MySQL driver is installed on the server by running the following command in the terminal:
php -m | grep mysql

If the output shows "mysql", then the driver is installed. If not, you need to install it.

  1. Install the MySQL driver by running the following command in the terminal:
sudo apt-get install php-mysql
  1. Restart the web server to apply the changes:
sudo service apache2 restart

If you are using a different web server, replace "apache2" with the name of your web server.

  1. If the above steps do not work, check if the MySQL driver is enabled in the PHP configuration file (php.ini). Open the file and search for the following line:
;extension=mysqli

Remove the semicolon (;) at the beginning of the line to enable the driver:

extension=mysqli

Save the file and restart the web server.

Hopefully, one of these steps will solve the issue.

6 likes

Please or to participate in this conversation.