I have still problem with mysql installation on alpine in docker.
I need also openjdk:8u201-jdk-alpine3.9.
My dockerfile:
FROM openjdk:8u201-jdk-alpine3.9
RUN apk update && \
apk add mysql mysql-client && \
rm -f /var/cache/apk/* && \
addgroup mysql mysql && \
mkdir run/mysqld && \
touch /var/run/mysqld/mysqld.sock && \
touch /var/run/mysqld/mysqld.pid && \
chown -R mysql:mysql /var/run/mysqld/mysqld.sock && \
chown -R mysql:mysql /var/run/mysqld/mysqld.pid && \
chmod -R 644 /var/run/mysqld/mysqld.sock && \
apk add openrc --no-cache
But, in container: - there is no mysql service (only mariadb, but it is probably standard situation for alpine) - there is no any my.cnf file in /etc/mysql directory
When I tried mysql command, I got error:
Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (111)
When I tried mysql -h 127.0.0.1 -P 3306 -u root command, I got error:
Can't connect to MySQL server on '127.0.0.1' (115)
That same for localhost.