0

I've just installed a Percona instance of Mysql on an Amazon server and can not find the my.cnf file anywhere. I found auto.cnf in /var/lib/mysql but there is nothing in that file like what I have seen for my standard mysql installs.

I'm using:

mysql  Ver 14.14 Distrib 5.6.41-84.1, for Linux (x86_64) using  6.2

Previously I've used 5.6.14 and 5.6.35 I guess this version changed a bit?

I tried mysqld --help --verbose | grep my.cnf | tr " " "\n", find . -iname "my.cnf", find / -iname "my.cnf", locate my.cnf, and whereis my.cnf. The whereis gave back a changed the shell, but had the same end result as all other commands which was no my.cnf found.

The whereis appended my: before my shell prompt e.g. [root@ip-ip_address /]#.

Mysql is running but from all SO threads I read there is no global variable I can select to find the conf file. Does anyone know how I can find where my configuration file lives?

2

No there is no global variable for the config file locations. mysqld --help --verbose is best to show which ones are used.

Take a look at the linux processlist to see how mysqld is executed by init/service/systemd, that might specify a file.

Otherwise you might be running on a default config with no configuration file.

  • mysqld --help --verbose gives me back 5 my.cnfs but none of them actual exist when I use ls on the locations. – user3783243 Sep 18 '18 at 22:51
  • Which would indicate you have no configuration files. meaning you have a totally default configuration based on the internal defaults built into mysqld. – danblack Sep 18 '18 at 22:53
  • ps aux | grep 'mysql' -i gave me back mysql .... /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/ip-LAN.err --pid-file=/var/lib/mysql/ip-LAN.pid so that sounds like it is defining the settings dynamically. Can I do touch /etc/my.cnf and mysql will just use the file or do I need to set that up somewhere? – user3783243 Sep 19 '18 at 12:20
  • The touch worked for setting the settings but there is still no reference to it in the output of the ps aux. All the settings I changed are just added in with --name=value. – user3783243 Sep 19 '18 at 12:30
0

Another place to look:

ls -ld /etc/*/my.cnf

It might be here:

/etc/mysql/percona-server.cnf

which is a softlink:

/etc/mysql/my.cnf -> /etc/alternatives/my.cnf -> /etc/mysql/percona-server.cnf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.