Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16879

MariaDB no longer reads /etc/mysql/my.cnf

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.3.8, 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
    • N/A
    • None
    • Fedora, RHEL

    Description

      Hello,

      MariaDB should search 3 locations for a config files:
      /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

      However it only does 2 now, ommiting /etc/mysql/my.cnf


      In RHEL there is a MariaDB 5.5 in base, which reads all of the three locations.
      In addition there are software collections which makes 10.2 and 10.3 available for the customers. The 10.3 version reads only 2 locations and also says such in the "mysqld --help --verbose"


      I'd love to get it either fixed so it will accept all of the 3 locations as usual, or properly reasonably documented, why it was removed.


      Downstream tracker (RedHat Bugzilla): #598173

      Hint from IRC discussion:
      It * could * be in MariaDB source for RPM builds only.
      Thus not reproducible without RPM packages.

      Fast command to check the mysqld help:

      /usr/libexec/mysqld --help --verbose | grep --after=1 '^Default options' | tail -n 1
      

      Attachments

        Issue Links

          Activity

            alice Alice Sherepa added a comment -

            Reproduced on Centos 7.5.1804 docker image, built with yum (sudo yum install MariaDB-server MariaDB-client)

            [root@bc1b8047d3c0]# mysql --help | grep "Default options" -A 1 
            Default options are read from the following files in the given order:
            /etc/my.cnf ~/.my.cnf
            

            alice Alice Sherepa added a comment - Reproduced on Centos 7.5.1804 docker image, built with yum (sudo yum install MariaDB-server MariaDB-client) [root@bc1b8047d3c0]# mysql --help | grep "Default options" -A 1 Default options are read from the following files in the given order: /etc/my.cnf ~/.my.cnf

            The change was made in 10.0, in the scope of MDEV-6485.

            commit 91c47e6fdf9aff728761177aff731442efc5ab29
            Author: Sergei Golubchik
            Date:   Sun Aug 3 17:13:56 2014 +0200
             
                MDEV-6485 Hard-coded paths in the source cannot be opt-out
                
                when looking for my.cnf files: if DEFAULT_SYSCONFDIR (or INSTALL_SYSCONFDIR)
                is specified (for rpms it always is), use that instead of hardcoded /etc path.
            

            Before that, /etc/ and /etc/mysql were looked into unconditionally; after the change, they are only looked into if DEFAULT_SYSCONFDIR (or INSTALL_SYSCONFDIR) are not specified, and just as the commit comment says, for RPMs it always is.

            Assigning to serg for deciding on further actions.

            elenst Elena Stepanova added a comment - The change was made in 10.0, in the scope of MDEV-6485 . commit 91c47e6fdf9aff728761177aff731442efc5ab29 Author: Sergei Golubchik Date: Sun Aug 3 17:13:56 2014 +0200   MDEV-6485 Hard-coded paths in the source cannot be opt-out when looking for my.cnf files: if DEFAULT_SYSCONFDIR (or INSTALL_SYSCONFDIR) is specified (for rpms it always is), use that instead of hardcoded /etc path. Before that, /etc/ and /etc/mysql were looked into unconditionally; after the change, they are only looked into if DEFAULT_SYSCONFDIR (or INSTALL_SYSCONFDIR) are not specified, and just as the commit comment says, for RPMs it always is. Assigning to serg for deciding on further actions.

            mschorm, as you can see the patch from MDEV-6485 was contributed by hhorak, part of the reasoning being "The attached are two related patches we use in Fedora".

            I'm a bit confused now.

            serg Sergei Golubchik added a comment - mschorm , as you can see the patch from MDEV-6485 was contributed by hhorak , part of the reasoning being "The attached are two related patches we use in Fedora". I'm a bit confused now.
            hhorak Honza Horak added a comment -

            The original idea of the patches in MDEV-6485 was to not hard-code the paths, but rather use the CMAKE-configured paths for the my.cnf. Removing /etc/mysql/my.cnf was not the intention, I'd maybe call it even an incomplete patch, and it would probably be ok to include also "DEFAULT_SYSCONFDIR+/mysql".

            Anyway, since for our distros (Fedora, RHEL, CentOS), the path /etc/mysql/my.cnf was never used, and for non-RPM distros the /etc/mysql/my.cnf still works (according to https://mariadb.com/kb/en/library/configuring-mariadb-with-mycnf/), I don't consider it a real problem for users and we should be fine to keep it.. So, unless somebody disagrees, I'd be fine with closing this issue.

            hhorak Honza Horak added a comment - The original idea of the patches in MDEV-6485 was to not hard-code the paths, but rather use the CMAKE-configured paths for the my.cnf. Removing /etc/mysql/my.cnf was not the intention, I'd maybe call it even an incomplete patch, and it would probably be ok to include also "DEFAULT_SYSCONFDIR+/mysql". Anyway, since for our distros (Fedora, RHEL, CentOS), the path /etc/mysql/my.cnf was never used, and for non-RPM distros the /etc/mysql/my.cnf still works (according to https://mariadb.com/kb/en/library/configuring-mariadb-with-mycnf/ ), I don't consider it a real problem for users and we should be fine to keep it.. So, unless somebody disagrees, I'd be fine with closing this issue.

            The behavior is:

            • if the location for my.cnf was specified at compile time, my.cnf is looked up there.
              • for RPM packages this location is /etc
            • if the location was not specified, the historical hard-coded paths /etc/my.cnf and /etc/mysql/my.cnf are used (presumably something that works both on rpm and deb based distros).
            serg Sergei Golubchik added a comment - The behavior is: if the location for my.cnf was specified at compile time, my.cnf is looked up there. for RPM packages this location is /etc if the location was not specified, the historical hard-coded paths /etc/my.cnf and /etc/mysql/my.cnf are used (presumably something that works both on rpm and deb based distros).

            People

              serg Sergei Golubchik
              mschorm Michal Schorm
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.