Personally, I run a dev/test instance of MariaDB on the same host as my production MariaDB. This way, while I'm testing something I can ensure it works fine on the host while making sure I don't accidentally transform any production data.
I also know people who run a single container for each MariaDB database using the hosts network and therefore each database has it's own port. (You can do things like resource constrain each container differently. IE, unlimited resources for the most important things, and limited resources for less important things such as dev/test databases.)
wrongecho you can edit the connection string in the config.php file to allow for this
Ok, I'll copy a config.php from a setup that uses the standard port, then edit the config and copy it to the host where I want to try it on a non-standard port. (Unless there is a better way to do this, because the setup wizard fails if the database connection doesn't succeed.)