$ docker run --name test-mysql -e MYSQL_ROOT_PASSWORD=my-password -d mysql:latest
</pre>
*別コンテナからクライアント起動接続<pre>$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES cccc85ac63e0 mysql:latest "docker-entrypoint.s..." 10 hours ago Up 8 minutes 3306/tcp, 33060/tcp test- mysql$ docker exec -it ccc bashroot@cccc85ac63e0:/# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 8Server version: 8.0.21 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql></pre>