Using mariadb for multiple services

Hi all,
i want to set my docker container up to serve multiple services, unfortunately, after following the guide on the website of creating a database, I get greeted with this message:
when using ip:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused

when using localhost:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory

Iā€™m doubting what ip I should use since they are in the same docker-compose. Can I use localhost or the ip of the container?

I understand that you want to create two databases in the same container, right? I think it goes against microservices architecture principlesā€¦

I do agree thatā€™s the case but willing to take the risk.

The setup part has been good, using the guide of Nextcloud.

The issue Iā€™m facing now is the 0770 permission issue. I have set all the permissions using chmod 0770 -R on the data folder. unfortunately, that doesnā€™t solve the case. Itā€™s a drive mounted with through fstab with cifs

Sorry i do not really understand your problem. But if you use ā€œfstab with cifsā€ you must set perhaps the needed Nextcloud user direct in the fstab settings. I think your Nextcloud user can not access despite 0770. Why do you use ā€œfstab with cifsā€. Can you explain it? Is your database on the cifs storage? I do not understand your setting.