Use mysql with docker expose port and share data folder

I don’t know why this is not in the list of examples on the mysql website. One of the first thing I want to know is if mysql is up and running and be able to connect to it using a mysql client like dbeaver. Also, I want to be able to keep my data in case I delete the docker image.

1
docker run -p 3306:3306 --name mysql -v c:/dev/data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql