Я пытаюсь запустить MYSQLD, чтобы сгенерировать некоторые данные для дампа в файл в docker образе (на самом деле мне не нужно MYSQL запускаться после этого)
USER mysql
RUN mysqld --initialize-insecure
RUN mysqld --daemonize --skip-networking
RUN mysql --protocol=socket -uroot -hlocalhost -e "create table DDD"
Кажется, все go нормально, пока я не нажму
"0.205 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)",
, что странно для меня, так как я понимаю это сразу после
/usr/sbin/mysqld: ready for connections. Version: '8.0.20' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
что я делаю не так?
#15 [11/13] RUN mysqld --initialize-insecure
#15 0.210 2020-05-03T21:27:14.416004Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.20) initializing of server in progress as process 7
#15 0.211 2020-05-03T21:27:14.420895Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
#15 0.535 2020-05-03T21:27:14.744127Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
#15 1.665 2020-05-03T21:27:15.874257Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
#15 DONE 3.7s
#16 [12/13] RUN mysqld --daemonize --skip-networking
#16 0.434 2020-05-03T21:27:18.296394Z 0 [Warning] [MY-010101] [Server] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
#16 0.434 2020-05-03T21:27:18.296447Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20) starting as process 8
#16 0.435 2020-05-03T21:27:18.309882Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
#16 2.820 2020-05-03T21:27:20.693463Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
#16 3.005 2020-05-03T21:27:20.878562Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock'
#16 3.214 2020-05-03T21:27:21.087873Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
#16 3.230 2020-05-03T21:27:21.103997Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.20' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
#16 DONE 3.9s
#17 [13/13] RUN mysql --protocol=socket -uroot -hlocalhost -e "create table ...
#17 0.205 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
#17 ERROR: executor failed running [/bin/sh -c mysql --protocol=socket -uroot -hlocalhost -e "create table DDD"]: runc did not terminate sucessfully