1

Topic: [Docker] I can not launch MySQL

Like such commands MySQL it is put ENV MYSQL_PWD ** something strongly secret ** RUN echo "mysql-server mysql-server/root_password password $MYSQL_PWD" | debconf-set-selections RUN echo "mysql-server mysql-server/root_password_again password $MYSQL_PWD" | debconf-set-selections RUN apt-get-y install mysql-server mysql-client but if I do further something like (that is tried in a large quantity of variants) RUN mysql-uroot-e "create database cmsdata" result always one: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2) Recommendations about this error everywhere are a lot of, but working among them for two hours it was not possible to find. P. S. Standard containers not to offer - it is finite, it is a lot of them, but for all occasions all the same is not. These lines only some part of that is necessary.

2

Re: [Docker] I can not launch MySQL

Hello, Ilya81, you wrote: I> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2) Error of that are connected from a host, and the socket remained in the container. Or  a socket outside through-v or to be connected on TCP.

3

Re: [Docker] I can not launch MySQL

Hello, scf, you wrote: scf> Hello, Ilya81, you wrote: I>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2) scf> the Error of that are connected from a host, and the socket remained in the container. scf> or  a socket outside through-v or to be connected on TCP. It is strange, why so happens, if it is a command inside Dockerfile (well or through exec). The purpose is connection in the container, its sites with CMS should use, and outside visibility it is necessary only for sites.

4

Re: [Docker] I can not launch MySQL

Hello, Ilya81, you wrote: I> RUN mysql-uroot-e "create database cmsdata" I> [/vb] I> that result always one: I> [q] I> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2) I Will assume that you  mysql, but its server have not been launched in the docker. Try to launch mysql-server before reversal to it.

5

Re: [Docker] I can not launch MySQL

Hello, lpd, you wrote: lpd> Hello, Ilya81, you wrote: I>> RUN mysql-uroot-e "create database cmsdata" I>> [/vb] I>> that result always one: I>> [q] I>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock ' (2) lpd> I Will assume that you  mysql, but its server have not been launched in the docker. Try to launch mysql-server before reversal to it. I not so well know Docker, but what will do one more of checked variants (that result, certainly)? A part under the found recommendations from already set questions. I try now under MacOS High Sierra, but the server is planned on Ubuntu. If last in  can influence, that is possibility to deliver VirtualBox. How much most it was possible to understand, Docker on MacOS it is used similar VirtualBox a superstructure with Linux. FROM ubuntu RUN apt-get update RUN apt-get-y install apache2 EXPOSE 80 RUN apt-get update ENV MYSQL_PWD ** something strongly secret ** RUN echo "mysql-server mysql-server/root_password password $MYSQL_PWD" | debconf-set-selections RUN echo "mysql-server mysql-server/root_password_again password $MYSQL_PWD" | debconf-set-selections RUN apt-get-y install mysql-server mysql-client RUN apt-get-y install supervisor libapache2-mod-php7.0 php7.0-mysql RUN apt-get-y install php-gd php-apcu php-mcrypt php7.0-xml ADD supervisor-lamp.conf/etc/supervisor/conf.d/RUN/etc/init.d/mysql start &&/etc/init.d/mysql-uroot-e "create database cmsdata"