docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.47k stars 2.2k forks source link

Unable to load custom cnf file #1081

Open rohitsodhia opened 2 months ago

rohitsodhia commented 2 months ago

I'm struggling to set up a custom config file. I started on 8.3 (6f343283ab56) and just tried 8.4 (5c0b42e12aec).

I have the following cnf file:

[mysqld]
default_authentication_plugin = mysql_native_password
# query_cache_size=16M

# MY-013360 - mysql_native_password notice
log_error_suppression_list='MY-013360'

I mount it via compose as:

    volumes:
      - ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf

And when I ssh in, I can see the file. But when I run show global variables like 'log_error_suppression_list';, I get back an empty string, as well as still seeing the error in my logs.

I see !includedir /etc/mysql/conf.d/ in the /etc/my.cnf (though the docs say The default configuration for MySQL can be found in /etc/mysql/my.cnf).

tianon commented 2 months ago

Hmm, are there any warnings in your logs about MySQL ignoring your cnf file? I seem to recall it's picky about (unix filesystem) permissions on configuration files.

rohitsodhia commented 2 months ago

You're right, I didn't notice

World-writable config file '/etc/mysql/conf.d/gp.cnf' is ignored.

Do you know what permissions I should set the file to?

tianon commented 2 months ago

Anything that doesn't have the word-writable bit should be fine; I think 644 or 664 are pretty standard.