Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default configuration /etc/mysql/my.cnf doesn't exist. Instead there's /etc/my.cnf. #792

Closed
lzandman opened this issue Oct 12, 2021 · 5 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@lzandman
Copy link

According to the official container description and many online sources the MySQL config file should be located at /etc/mysql/my.cnf. However, when I look in the container the folder /etc/mysql doesn't exist. It appears the default config file is located at /etc/my.cnf. Why has this changed and why didn't the docs get updated? How do I add custom config stuff to a container?

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Oct 12, 2021
@wglambert
Copy link

Can you give all the commands you ran and any relevant files or logs for reproducing the issue

$ docker run -d --rm -e MYSQL_ROOT_PASSWORD=root mysql
Unable to find image 'mysql:latest' locally
latest: Pulling from library/mysql
07aded7c29c6: Pull complete 
f68b8cbd22de: Pull complete 
30c1754a28c4: Pull complete 
1b7cb4d6fe05: Pull complete 
79a41dc56b9a: Pull complete 
00a75e3842fb: Pull complete 
b36a6919c217: Pull complete 
635b0b84d686: Pull complete 
6d24c7242d02: Pull complete 
5be6c5edf16f: Pull complete 
cb35eac1242c: Pull complete 
a573d4e1c407: Pull complete 
Digest: sha256:4fcf5df6c46c80db19675a5c067e737c1bc8b0e78e94e816a778ae2c6577213d
Status: Downloaded newer image for mysql:latest
a2d809c052fabaa0a474af48b78e5f981d0fe6a475a4203944694fa865507325

$ docker exec -it a2d bash
root@a2d809c052fa:/# ls /etc/mysql/
conf.d  my.cnf  my.cnf.fallback

@lzandman
Copy link
Author

Sure, here's the output of a session where I run the latest MySQL Docker container, shell into it and show that there's no /etc/mysql folder:

leon@Leons-MacBook-Air ~ % docker run -d --name mysqltest --rm -e MYSQL_ROOT_PASSWORD=root mysql/mysql-server:latest
Unable to find image 'mysql/mysql-server:latest' locally
latest: Pulling from mysql/mysql-server
003b5815c7df: Already exists 
b3cc6a7258f9: Already exists 
6ec0b9780de7: Already exists 
3bd4cb0b78d1: Already exists 
a6004dbd9ba2: Already exists 
b33be9f4a1f3: Already exists 
38b3da6a86f7: Already exists 
Digest: sha256:5241f7de0483a70f5856da995fea98904cfce8f1c51734b7f3836c1663eead17
Status: Downloaded newer image for mysql/mysql-server:latest
94efe905ea841afcfc75a62c0de570519719fd6e8167e345771e06807a33fdf9
leon@Leons-MacBook-Air ~ % docker exec -it mysqltest bash
bash-4.4# cd /etc
bash-4.4# ls -ld my*
-rw-r--r-- 1 root root 1239 Jul  1 11:10 my.cnf
drwxr-xr-x 2 root root 4096 Jul  1 11:10 my.cnf.d
bash-4.4# head my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
bash-4.4# cd my.cnf.d
bash-4.4# ls -la
total 8
drwxr-xr-x 2 root root 4096 Jul  1 11:10 .
drwxr-xr-x 1 root root 4096 Oct 12 19:38 ..
bash-4.4# cd ..
bash-4.4# ls /etc/mysql
ls: cannot access '/etc/mysql': No such file or directory
bash-4.4# pwd
/etc
bash-4.4# ls
GREP_COLORS		filesystems  krb5.conf.d	openldap	rc1.d		skel
X11			gcrypt	     ld.so.cache	opt		rc2.d		ssl
aliases			gnupg	     ld.so.conf		oracle-release	rc3.d		subgid
alternatives		group	     ld.so.conf.d	os-release	rc4.d		subuid
bash_completion.d	group-	     libaudit.conf	passwd		rc5.d		sysconfig
bashrc			gshadow      libssh		passwd-		rc6.d		system-release
bindresvport.blacklist	gshadow-     localtime		pkcs11		redhat-release	system-release-cpe
chkconfig.d		gss	     login.defs		pki		resolv.conf	terminfo
crypto-policies		host.conf    motd		pm		rpc		xattr.conf
csh.cshrc		hostname     mtab		popt.d		rpm		xdg
csh.login		hosts	     my.cnf		printcap	sasl2		xinetd.d
default			init.d	     my.cnf.d		profile		selinux		yum.repos.d
dnf			inputrc      netconfig		profile.d	services
environment		issue	     networks		protocols	shadow
ethertypes		issue.net    nsswitch.conf	rc.d		shadow-
exports			krb5.conf    nsswitch.conf.bak	rc0.d		shells

@wglambert
Copy link

Ah yeah mysql/mysql-server is actually a different image maintained by the MySQL team at Oracle
https://hub.docker.com/r/mysql/mysql-server/

@tianon tianon closed this as completed Oct 12, 2021
@lzandman
Copy link
Author

Ah yeah mysql/mysql-server is actually a different image maintained by the MySQL team at Oracle
https://hub.docker.com/r/mysql/mysql-server/

Somewhere I messed up, because I actually started at the official mysql image. But when I try to start such a container, it says it isn't available for my Mac M1 ARM, I guess....

leon@Leons-MacBook-Air ~ % docker run -d --name mysqltest --rm -e MYSQL_ROOT_PASSWORD=root mysql:latest      
Unable to find image 'mysql:latest' locally
latest: Pulling from library/mysql
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.

@tianon
Copy link
Member

tianon commented Oct 12, 2021

Yeah, that's unfortunately expected; see #318.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

3 participants