Trying to change the database - where is my syntax wrong?

Hardware: Raspberry Pi 3B
OS: Debian 12
Nextcloud Server version: 30.0.6.2 installed from .zip file

I’m trying to change the database from default sqlite3 to mysql using command line:

sudo -u www-data /var/www/html/nextcloud/occ db:convert-type -vv --password=XXXXXXXXXX --clear-schema --all-apps mysql howard raspi-dmz nextcloud

It throws the following exception:

In Connection.php line 233:

  •                                                                                                                 *
    
  • [Doctrine\DBAL\Exception (2002)] *
  • Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused *
  •                                                                                                                 *
    

Exception trace:

  • at /var/www/html/nextcloud/lib/private/DB/Connection.php:233*
  • OC\DB\Connection->connect() at /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:458*
  • Doctrine\DBAL\Connection->getDatabasePlatformVersion() at /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:416*
  • Doctrine\DBAL\Connection->detectDatabasePlatform() at /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:323*
  • Doctrine\DBAL\Connection->getDatabasePlatform() at /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Schema/LegacySchemaManagerFactory.php:16*
  • Doctrine\DBAL\Schema\LegacySchemaManagerFactory->createSchemaManager() at /var/www/html/nextcloud/3rdparty/doctrine/dbal/src/Connection.php:1720*
  • Doctrine\DBAL\Connection->createSchemaManager() at /var/www/html/nextcloud/core/Command/Db/ConvertType.php:254*
  • OC\Core\Command\Db\ConvertType->getTables() at /var/www/html/nextcloud/core/Command/Db/ConvertType.php:236*
  • OC\Core\Command\Db\ConvertType->clearSchema() at /var/www/html/nextcloud/core/Command/Db/ConvertType.php:163*
  • OC\Core\Command\Db\ConvertType->execute() at /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php:326*
  • Symfony\Component\Console\Command\Command->run() at /var/www/html/nextcloud/3rdparty/symfony/console/Application.php:1078*
  • Symfony\Component\Console\Application->doRunCommand() at /var/www/html/nextcloud/3rdparty/symfony/console/Application.php:324*
  • Symfony\Component\Console\Application->doRun() at /var/www/html/nextcloud/3rdparty/symfony/console/Application.php:175*
  • Symfony\Component\Console\Application->run() at /var/www/html/nextcloud/lib/private/Console/Application.php:183*
  • OC\Console\Application->run() at /var/www/html/nextcloud/console.php:87*
  • require_once() at /var/www/html/nextcloud/occ:11*

db:convert-type [–port PORT] [–password PASSWORD] [–clear-schema] [–all-apps] [–chunk-size CHUNK-SIZE] [–]

The syntax looks good to me,but can anyone spot my mistake?

Connecting manually to the database works?
mysql -u nextcloud -h raspi-dmz -pXXXXXXXXXX howard