Docker进入mysql容器

https://blog.csdn.net/weixin_39800144/article/details/80872515

先启动mysql服务,启动mysql后,如果想进入mysql的命令行,执行如下命令

  1. [root@izbp163wlhi02tcaxyuxb7z ~]# docker exec -it mysql1 bash //mysql1是我启动的mysql服务的name
  2. root@654c15160c66:/# mysql -uroot -p
  3. Enter password:
  4. //输入密码即可
  5. Welcome to the MySQL monitor. Commands end with ; or \g.
  6. Your MySQL connection id is 9
  7. Server version: 8.0.11 MySQL Community Server - GPL
  8. Oracle is a registered trademark of Oracle Corporation and/or its
  9. affiliates. Other names may be trademarks of their respective
  10. owners.
  11. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  12. mysql>
  13. //已经进入命令行模式

————————————————
版权声明:本文为CSDN博主「IT云清」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_39800144/article/details/80872515