Unable to convert DB from sqlite to mysql

Hi,

I’ve been using Nextcloud for a while now but have been exoperiencing issues with files being locked when multiple clients reading & writing to them at the same time and have figured, that I should upgrade to using mysql instead - which is what I’m facing troubles with.
I pasted the commands to create the DB and also the command to invoke the conversion below.

Nextcloud version (eg, 20.0.5): 17.0.3
Operating system and version (eg, Ubuntu 20.04): Raspbian GNU/Linux 10 (buster)
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.4): 7.3.19

The issue you are facing:

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

Steps to replicate it:

  1. Create DB with command:
$ sudo mysql -uroot -p CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER nextcloud@localhost identified by 'password'; GRANT ALL PRIVILEGES on nextcloud.* to nextcloud@localhost; FLUSH privileges; quit;
  1. invoke conversion
 sudo -u www-data php occ db:convert-type --all-apps mysql nextcloud 127.0.0.1 nextcloud
  1. Receive following error:
In Connection.php line 64:
                                                                                                                                                                  
  Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'nextcloud'@'localhost' (using password: YES  
  )                                                                                                                                                               
                                                                                                                                                                  

db:convert-type [--port PORT] [--password PASSWORD] [--clear-schema] [--all-apps] [--chunk-size CHUNK-SIZE] [--] <type> <username> <hostname> <database>

The output of your Nextcloud log in Admin > Logging:

No server logs

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

<?php
$CONFIG = array (
  'instanceid' => 'instance',
  'passwordsalt' => 'salt',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => 'raspi',
    1 => 'IP',
    2 => 'url.duckdns.org',
  ),
  'datadirectory' => '/var/nextcloud/data',
  'dbtype' => 'sqlite3',
  'version' => '17.0.3.1',
  'overwrite.cli.url' => 'http://raspi/nextcloud',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'mail_from_address' => 'user',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'example.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.example.com',
  'mail_smtpport' => '465',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpname' => 'user@example.com',
  'mail_smtppassword' => 'pass',
  'filelocking.enabled' => true,
  'blacklisted_files' => 
  array (
    0 => '.htaccess',
  ),
  'onlyoffice' => 
  array (
    'verify_peer_off' => true,
  ),
  'app_install_overwrite' => 
  array (
    0 => 'twofactor_rcdevsopenotp',
  ),
  'updater.secret' => secret',
);

The output of your Apache/nginx/system log in /var/log/apache2/access.log:

192.168.1.222 - stdcerr [23/Jan/2021:06:15:36 +0000] "GET /nextcloud/ocs/v2.php/core/navigation/apps?absolute=true&format=json HTTP/1.1" 304 3966 "-" "Mozilla/5.0 (Linux) mirall/3.0.3git (Nextcloud)"
192.168.1.1 - - [23/Jan/2021:06:15:42 +0000] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 1430 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0"
192.168.1.222 - stdcerr [23/Jan/2021:06:15:52 +0000] "PROPFIND /nextcloud/remote.php/dav/files/stdcerr/ HTTP/1.1" 207 4820 "-" "Mozilla/5.0 (Linux) mirall/3.0.3git (Nextcloud)"
192.168.1.222 - stdcerr [23/Jan/2021:06:16:04 +0000] "GET /nextcloud/ocs/v1.php/cloud/user?format=json HTTP/1.1" 200 5015 "-" "Mozilla/5.0 (Linux) mirall/3.0.3git (Nextcloud)"
192.168.1.222 - stdcerr [23/Jan/2021:06:16:05 +0000] "GET /nextcloud/remote.php/dav/avatars/stdcerr/128.png HTTP/1.1" 200 3024 "-" "Mozilla/5.0 (Linux) mirall/3.0.3git (Nextcloud)"
192.168.1.222 - stdcerr [23/Jan/2021:06:16:08 +0000] "PROPFIND /nextcloud/remote.php/dav/files/stdcerr/ HTTP/1.1" 207 1166 "-" "Mozilla/5.0 (Linux) mirall/3.0.3git (Nextcloud)"
192.168.1.222 - stdcerr [23/Jan/2021:06:16:08 +0000] "GET /nextcloud/ocs/v2.php/core/navigation/apps?absolute=true&format=json HTTP/1.1" 304 3966 "-" "Mozilla/5.0 (Linux) mirall/3.0.3git (Nextcloud)"