Issues converting database from sqlite to mariadb

Hello. have an issue with Nextcloud running in a container. I can’t seem to get it to convert from sqlite to mariadb. It seems to connect to the database since it indicates it is creating a new scheme in the database. I added the command I run in the nextcloud container.
I get no related issues in the Nextcloud logs. Any ideas?

www-data@d6d0b994a819:~/html$ php occ db:convert-type --all-apps -- mysql nextclouduser nextclouddb;
What is the database password?
Creating schema in new database

In Connection.php line 140:
  Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused  

hi @Wodkat welcome to the forum :handshake:

Please use the search - lot of issues have been discussed already - I remember there was similar thread shortly

sounds like there a networking issue - either there is no connection between containers or you are not using right ip/port combination.

Please add more details like your docker(-compose) command which allows us to understand the issue.

You can also search for the generic errors on the forum and search engine. Example:

Thanks for the replies. I see in the mariadb container logs now the following items;

Version: '10.6.5-MariaDB-1:10.6.5+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306 binary distribution
2023-11-22 21:12:17 3 [Warning] Aborted connection 3 to db: 'unconnected' user: 'unauthenticated' host: '' (This connection closed normally without authentication)
2023-11-22 21:12:17 4 [Warning] Aborted connection 4 to db: 'unconnected' user: 'unauthenticated' host: '' (This connection closed normally without authentication)

When I replace the hostname with the name of the container ‘nextcloud-mariadb’ there are nog log entries in the mariadb container.

I gave user nextclouduser fill priviliges to all databases.

This is my config file on the nextlocud container:

$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
  'instanceid' => 'XXXXX',
  'secret' => 'XXXX/XXX',
  'trusted_domains' => 
  array (
   0 => '',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'sqlite3',
  'version' => '',
  'overwrite.cli.url' => '',
  'overwriteprotocol' => 'https',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpport' => '587',
  'mail_from_address' => 'XXXXX'
  'mail_domain' => '',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'XXXX',
  'mail_smtppassword' => 'XXXXXX',
  'maintenance' => false,
  'default_phone_region' => 'NL',

and how did you connect Nextcloud and #mariadb containers?