Docker
This document provides helpful Docker
commands and snippets.
Remove unused containers, images, volumes and networks
Install a MySQL server
Pull image:
Start container:
Run mysql
from the container:
Run mysql
from the terminal:
Note: Connect to
127.0.0.1
instead oflocalhost
on Ubuntu to solveERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
.
Send a SQL file to the container:
In a mysql
session, execute the SQL file and quit:
source /file.sql
\quit