Stopping mariadb service without stopping/restarting mariadb container
Solution 1:
For most purposes a Docker container is the main process running in the container; if you stop the process, the container stops too. In the same way you don't "go inside" a database process and stop individual threads, you don't usually "go inside" a Docker container to manage processes; in most cases there will be only one.
I'd suggest reserving docker exec
for exceptional situations: it's a very useful debugging tool, but not the normal way to manage a container. I'd also never leave a container in "stopped" state. It's very normal to delete and recreate a container and that's what I'd recommend here.
docker stop 9eb7765a7f47
docker rm 9eb7765a7f47
docker run -d -p3306:3306 --name mysql -v ... mysql