Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 20.0.7
Operating system and version (eg, Ubuntu 20.04): debian 10
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.4): 7.4

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. php occ db:convert-type --all-apps mysql oc_mysql_user 127.0.0.1 new_db_name in SSH

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

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

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '192.168.8.245:9700',
    1 => 'nextcloud.konyks.biz',
  ),
  'trusted_proxies' => 
  array (
    0 => '127.0.0.1',
  ),
  'forwarded_for_headers' => 
  array (
    0 => 'HTTP_CF_CONNECTING_IP',
  ),
  'dbtype' => 'sqlite3',
  'version' => '20.0.7.1',
  'overwrite.cli.url' => 'https://192.168.8.245:9700',
  'installed' => true,
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Trying to convert to mariaDB and everytime I try using the occ convert command I get,
“Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver in /srv/dev-disk-by-label-media/containers/nextcloud/www/nextcloud/lib/private/DB/Connection.php:72”.
Have spent the last couple days trying to find a solution to no avail. Anyone have any ideas?

Have spent the last couple days trying to find a solution to no avail. Anyone have any ideas?

Several related discussions already exist on the forum which are related to your problem. See e.g.

https://help.nextcloud.com/search?q=failed%20to%20connect%20convert%20database

The usualy recommendation is to check the errors being logged to the Nextcloud server log and to make sure that your old and new database drivers are correctly loaded before you try to convert it to the new type.

There is already a detailed paragraph in the Adminsitrator guide which covers the database conversion:

https://docs.nextcloud.com/server/21/admin_manual/configuration_database/db_conversion.html?highlight=database%20convert#converting-database-type