Debian 11 mariadb upgrade: cannot connect

Earlier today I upgraded my vps running debian from v10 to v11. One of the upgrades was to mariadb v10.5. Unfortunately it broke my nextcloud installation. It appears NC can no longer connect to the db server.

Anyone have any thoughts about what is going here?

Nextcloud version: 20.0.11.1
Operating system and version: debian 11
Apache or nginx version: 2.4.48-3.1
PHP version: 7.4

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '+',
  'trusted_domains' => 
  array (
    0 => 'myhost1',
    2 => 'myhost2',
  ),
  'datadirectory' => '/home/data',
  'dbtype' => 'mysql',
  'version' => '20.0.11.1',
  'overwrite.cli.url' => 'http://myhost/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxx',
  'installed' => true,
  'theme' => '',
  'loglevel' => 0,
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud.log',
  'logdateformat' => 'F d, Y H:i:s',
  'maintenance' => false,
  'app_install_overwrite' => 
  array (
    0 => 'calendar',
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'localhost',
  'mail_sendmailmode' => 'smtp',
 'mail_from_address' => 'xxx',
  'mail_domain' => 'xxx',
  'trashbin_retention_obligation' => '7, auto',
  'versions_retention_obligation' => '7, auto',
);

apache error log:

Fri Aug 06 22:23:00.273818 2021] [php7:error] [pid 5284] [client 7##.##.##.##:54054] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver in /var/www/html/nextcloud/lib/private/DB/Connection.php:72\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1449): OC\\DB\\Connection->connect()\n#1 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(892): Doctrine\\DBAL\\Connection->getWrappedConnection()\n#2 /var/www/html/nextcloud/lib/private/DB/Connection.php(202): Doctrine\\DBAL\\Connection->executeQuery()\n#3 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): OC\\DB\\Connection->executeQuery()\n#4 /var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(248): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 /var/www/html/nextcloud/lib/private/AppConfig.php(345): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 /var/www/html/nextcloud/lib/private/AppConfig.php(110): OC\\AppConfig->loadConfigValues()\n#7 /var/www/html/ in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 72

Usually, not all required php modules are installed for the new php version:
https://docs.nextcloud.com/server/20/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

1 Like

afaik mariadb 10.5 is not supported (now). try a rollback to 10.4 and it should work…

https://docs.nextcloud.com/server/20/admin_manual/installation/system_requirements.html

10.5 is supported!

Any solution to this problem? I have the same issue today.

Did you check that you have pdo_mysql installed?

I had the same problem. I had to (re)install the “php-mysql” package.