title: Cannot use MySQL my.cnf file on Ubuntu 16.04 for mysql-5.7
body: <p>I have installed percona-xtradb-cluster-server-5.7 on an Ubuntu 16.04 server, and mysql is running fine with the default config our of the box. However, when i try edit the my.cnf file, i get errors that the variables are unknown, e.g.,:</p>
  
  <pre><code>mysql: [ERROR] unknown variable 'datadir=/var/mysql/mysql'
  </code></pre>
  
  <p>I have tried to locate different my.cnf file on the server and tried to add the variables in one after the other, but seem to be getting the same error. </p>
  
  <p>So my question is, where is the appropriate my.cnf file for MySQL 5.7 on Ubuntu 16.04? I have even tried in this: /etc/mysql/conf.d/mysql.cnf localtion and get the following error:</p>
  
  <pre><code>[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
   failed!
  </code></pre>
  
  <p>Below is info related to possible MySQL 5.7 config files on my Ubuntu 16.04 server</p>
  
  <pre><code>ubuntu@db-test-1:~$ sudo find / -name my.cnf
  /etc/mysql/my.cnf
  /etc/alternatives/my.cnf
  /var/lib/dpkg/alternatives/my.cnf
  ubuntu@db-test-1:~$
  ubuntu@db-test-1:~$ sudo ls -l /etc/mysql/
  total 20
  drwxr-xr-x 2 root root 4096 Oct 30 15:05 conf.d
  -rw-r--r-- 1 root root  237 Oct 30 12:42 debian.cnf
  -rw-r--r-- 1 root root  836 Oct 30 14:49 my.cnf
  -rw-r--r-- 1 root root  380 Oct 24 01:18 percona-xtradb-cluster.cnf
  drwxr-xr-x 2 root root 4096 Oct 30 11:51 percona-xtradb-cluster.conf.d
  ubuntu@db-test-1:~$ sudo ls -l /etc/mysql/conf.d/
  total 8
  -rw-r--r-- 1 root root  8 Oct 30 15:05 mysql.cnf
  -rw-r--r-- 1 root root 55 Jan 22  2017 mysqldump.cnf
  ubuntu@db-test-1:~$ /usr/sbin/mysqld --verbose --help | grep -A 1 "Default options"^C
  ubuntu@db-test-1:~$ sudo su
  root@db-test-1:/home/ubuntu# /usr/sbin/mysqld --verbose --help | grep -A 1 "Default options"
  Default options are read from the following files in the given order:
  /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
  </code></pre>
  
  <p>By the way, the debian.cnf file does not come with version 5.7, but i added it cos i need it for log rotate during flush logs. </p>
  
  <p>Below is my galera config at added at the bottom of the /etc/mysql/conf.d/mysql.cnf config file:</p>
  
  <pre><code>server-id = 1010101
  # Galera Config
  wsrep_cluster_address = gcomm://10.1.0.101, 10.1.0.101
  wsrep_cluster_name = db-hr
  wsrep_provider = /usr/lib/libgalera_smm.so    
  wsrep_provider_options = "gcache.size=4G"
  wsrep_slave_threads = 4
  wsrep_sst_auth = "user:secret"
  wsrep_sst_method = xtrabackup-v2
  </code></pre>