title: MySQL not picking up symlinked cnf changes in 5.7.13 on Ubuntu 16.04
body: <p>EDIT: I may have found what might be part of the issue, further edit at the bottom.</p>
  <p>I've got a new server setup running mysql everything seems to be okay. Except whenever I use show variables the configuration settings I can see in my .cnf file are not being shown and what appear to be general defaults are being shown. So it would appear while I can use mysql just fine, the settings are all just the defaults.</p>
  <p>I am trying to figure out why my .cnf is not being used. I have taken a number of steps to check that it is definitely being loaded and these are laid out below. Once I am sure it is being loaded I am at a loss as to how to explain why my settings aren't being used. Any help would be greatly appreciated.</p>
  <p>The location of my cnf file is this:</p>
  <blockquote>
  <p>/etc/mysql/mysql.conf.d/mysqld.cnf</p>
  </blockquote>
  <p>I have attempted to verify that this is what is being used by the following:</p>
  <p><code>sudo /usr/sbin/mysqld --verbose --help | grep -A 1 &quot;Default options&quot;</code></p>
  <blockquote>
  <p>Default options are read from the following files in the given order:</p>
  <p>/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf</p>
  </blockquote>
  <p><code>/etc/my.cnf</code> does not exist</p>
  <p><code>/etc/mysql/my.cnf</code> is a symlink to <code>/etc/alternatives/my.cnf</code></p>
  <p><code>/etc/alternatives/my.cnf</code> is a symlink to <code>/etc/mysql/mysql.cnf</code></p>
  <p><code>/etc/mysql/mysql.cnf</code> contains:</p>
  <blockquote>
  <p>!includedir /etc/mysql/conf.d/</p>
  <p>!includedir /etc/mysql/mysql.conf.d/</p>
  </blockquote>
  <p><code>etc/mysql/conf.d/</code> is a directory that contains:</p>
  <blockquote>
  <p>mysql.cnf</p>
  <p>mysqldump.cnf</p>
  </blockquote>
  <p><code>mysql.cnf</code> is empty so presumably isn’t doing anything</p>
  <p><code>/etc/mysql/mysql.conf.d/</code> is a directory that contains:</p>
  <blockquote>
  <p>mysqld.cnf</p>
  <p>mysqld.cnf.dpkg-new</p>
  <p>mysqld_safe_syslog.cnf</p>
  </blockquote>
  <p><code>mysqld.cnf</code> is a symlink to <code>/home/{my_username}/conf/mysqld.cnf</code></p>
  <p><code>/home/{my_username}/conf/mysqld.cnf</code> is my conf file which I expect it to be using.</p>
  <p>So I cannot see the problem it looks like it should be using my config.</p>
  <p>In a second attempt to verify that this .cnf is being used I used <code>strace mysql</code>. My file was listed and opened along with the other paths I just listed above.</p>
  <pre><code>stat(&quot;/etc/mysql/mysql.conf.d/mysqld.cnf&quot;, {st_mode=S_IFREG|0664, st_size=2262, ...}) = 0
  open(&quot;/etc/mysql/mysql.conf.d/mysqld.cnf&quot;, O_RDONLY) = 4
  fstat(4, {st_mode=S_IFREG|0664, st_size=2262, ...}) = 0
  read(4, &quot;# Generated by Percona Configura&quot;..., 4096) = 2262
  read(4, &quot;&quot;, 4096)                       = 0
  close(4)                          = 0 close(4)
  </code></pre>
  <p>Again it looks like it should be using the .cnf file.</p>
  <p>Can anyone offer any insight into why it's not?</p>
  <p>EDIT: I've just done a <code>strace mysqld</code> instead of <code>strace mysql</code> and I get a permission error on my .cnf file. This could be the problem. But I don't understand enough about the difference between mysql and mysqld can anyone explain?</p>
  <pre><code>stat(&quot;/etc/mysql/mysql.conf.d/mysqld.cnf&quot;, {st_mode=S_IFREG|0664, st_size=3218, ...}) = 0
  open(&quot;/etc/mysql/mysql.conf.d/mysqld.cnf&quot;, O_RDONLY) = -1 EACCES (Permission denied)
  </code></pre>