1

IT`s a fresh Magento 2.1 files

Initially all working fine , but after some time its giving this error

[Zend_Db_Adapter_Exception]
pdo_mysql extension is not installed
cache:clean [--bootstrap="..."] [types1] ... [typesN]

error

As per localhost/dashboard/phpinfo.php I am using PHP Version 5.6.30

maddy@maddy:/opt/lampp$ sudo apt-get install pdo-mysql php5.0-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package pdo-mysql
E: Unable to locate package php5.0-mysql
E: Couldn't find any package by glob 'php5.0-mysql'
E: Couldn't find any package by regex 'php5.0-mysql'
maddy@maddy:/opt/lampp$ 
   **Even below command don`t work**
maddy@maddy:/opt/lampp$ sudo apt-get install pdo-mysql php7.0-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package pdo-mysql

I checked the availability

maddy@maddy:~$ sudo phpenmod pdo_mysql
[sudo] password for maddy: 
WARNING: Module pdo_mysql ini file doesn't exist under /etc/php/7.0/mods-available
  • Have you installed any extension recently? – Murtuza Zabuawala Aug 4 '17 at 13:31
  • restart mysql by this command sudo service mysql restart – Murtuza Zabuawala Aug 4 '17 at 13:34
  • No not a single file is changed manually , nor i installed any plugin. – inrsaurabh Aug 4 '17 at 13:39
  • maddy@maddy:/opt/lampp$ sudo service mysql restart Failed to restart mysql.service: Unit mysql.service not found. – inrsaurabh Aug 4 '17 at 13:39
  • try sudo service mysqld start – Murtuza Zabuawala Aug 4 '17 at 13:41
6

type this in your terminal. this is because of missing php-mysql

For php7.0

sudo apt-get install php7.0-gd php7.0-mysql

For php5

sudo apt-get install php5-gd php5-mysql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.