MySQL takes several minutes to start-up the first time since it must initialize the database. I suspect it also restarts during that time which could cause some issues for Docker.
I’d recommend using -it to keep the container running and mounting a persistent volume so subsequent start-ups take a couple of seconds:
docker run \
-it --rm --name mysql \
-p 9876:3306 \
--mount "src=mysqldata,target=/var/lib/mysql" \
-e MYSQL_ROOT_PASSWORD=password \
mysql:5.6