Skip to content
Advertisement

Error: Undefined class constant ‘MYSQL_ATTR_USE_BUFFERED_QUERY’

Currently I’m getting this kind of message and I don’t know how to fix it.

The command php -m tells me that PDO and pdo_mysql are there.

I’m using Drupal-8 with php7.1.20 on Ubuntu 18.04.1 LTS

[Tue Sep 04 09:27:48.210064 2018] [php7:notice] [pid 2183] [client 10.56.99.1:53758] Error: Undefined class constant ‘MYSQL_ATTR_USE_BUFFERED_QUERY’ in /var/www/dev/web/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php on line 134 #0 /var/www/dev/web/core/lib/Drupal/Core/Database/Database.php(376): DrupalCoreDatabaseDrivermysqlConnection::open(Array)n#1 /var/www/dev/web/core/lib/Drupal/Core/Database/Database.php(166): DrupalCoreDatabaseDatabase::openConnection(‘default’, ‘default’)n#2 [internal function]: DrupalCoreDatabaseDatabase::getConnection(‘default’)n#3 /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(79): call_user_func_array(‘Drupal\Core\Dat…’, Array)n#4 /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): DrupalComponentDependencyInjectionPhpArrayContainer->createService(Array, ‘database’)n#5 /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(260): DrupalComponentDependencyInjectionContainer->get(‘database’, 1)n#6 /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(62): DrupalComponentDependencyInjectionPhpArrayContainer->resolveServicesAndParameters(Array)n#7 /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): DrupalComponentDependencyInjectionPhpArrayContainer->createService(Array, ‘cache.container’)n#8 /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(516): DrupalComponentDependencyInjectionContainer->get(‘cache.container’)n#9 /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(877): DrupalCoreDrupalKernel->getCachedContainerDefinition()n#10 /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(469): DrupalCoreDrupalKernel->initializeContainer()n#11 /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(665): DrupalCoreDrupalKernel->boot()n#12 /var/www/dev/web/index.php(19): DrupalCoreDrupalKernel->handle(Object(SymfonyComponentHttpFoundationRequest))n#13 {main}

Advertisement

Answer

Nvm.

apt-get install php-mysql and a simple service apache2 restart fixed atleast that error.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement