I'm trying to install mysql inside a docker container,Tried various images from github, it seems they all manage to successfully install the mysql but when I try to run the mysql it gives an error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
System specifications:
- Ubuntu 12,04 its on AWS
- Docker 0.10.0
Packages I tried so far:
Best Answer
Remember that you will need to connect to running docker container. So you probably want to use tcp instead of unix socket. Check output of
docker ps
command and look for running mysql containers. If you find one then use mysql command like this:mysql -h 127.0.0.1 -P <mysql_port>
(you will find port indocker ps
output). If you can't find any running mysql container indocker ps
output then trydocker images
to find mysql image name and try something like this to run it:docker run -d -p 3306:3306 tutum/mysql
where "tutum/mysql" is image name found indocker images
.