Recorder on Synology: Homeassistant in docker/ MariaDB on Synology

Since I finally got it running I want to share the following with you:
I am running Homeassistant in a docker on a Synology NAS. - Works fine!
I want to change the recorder database to MariaDB which is installed and already running for other purposes.
I added in the config YAML:
'db_url: mysql://user:password@localhost:/Homeassistant?charset=utf8mb4
This actually connected properly and created all the tables in the database!!

2023-05-19 16:38:18.616 ERROR (Recorder) [homeassistant.components.recorder.core] Error during connection setup:
(MySQLdb.OperationalError) (2002, “Can’t connect to local MySQL server through socket ‘/run/mysqld/mysqld.sock’ (2)”)

Logger: homeassistant.setup
First occurred: 16:21:35 (4 occurrences)
Last logged: 16:21:44
Setup failed for history: (DependencyError(…), ‘Could not setup dependencies: recorder’)
Setup failed for logbook: (DependencyError(…), ‘Could not setup dependencies: recorder’)
Setup failed for energy: (DependencyError(…), ‘Could not setup dependencies: history, recorder’)
Setup failed for default_config: (DependencyError(…), ‘Could not setup dependencies: energy, history, logbook’)

I found in the settings of Mariadb on the Synology:
The port should be: 3307
The domain socked shall be: /run/mysqld/mysqld10.sock
I tried all variations of the upper configuration - and failed!
Finally I used a ‘remote’ connection to the MariaDB instead of ‘localhost’.
I got the error message: Access denied.
Well this was an easy one: I had to allow remote access (from all hosts) for the user in the database.
Finally the config string looks like this:
``db_url: mysql://user:password@ip-address-of-synology-nas:3307/Homeassistant?unix_socket=/run/mysqld/mysqld10.sock&charset=utf8mb4`´

My question: Why were the database tables created with the initial configuration while the actual data taking failed (Could not setup dependencies)?
Any idea?