I am now using Docker for Mac and Docker is Docker version 1.12.0-rc4, build e4a0dbc, experimental
and I am trying to install MySQL in Ubuntu 16.10. (Do not ask me, why I don't use the official one!)
The installation process is
docker run --rm -it ubuntu:16.10
(and install vim)
apt-get update && apt-get upgrade -y
apt-get install -y mysql-server
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
...
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
# ls /var/run/
lock mount utmp <- there is no "mysqld" directory
Why I am making this mistake for several times and cannot use MySQL... ><
If you are trying to access mysql from your host system, your problem is that you aren't exposing port 3306 when you run the ubuntu image:
you need to add this to the run command:
docker run --rm -it -p 3306:3306 ubuntu:16.10
Can't imagine why you aren't using one of the usual mysql images, though you'd still have to expose the port.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.