The mySql file can be found in multiple default locations and under various names. e.g.
How can you find the mySql configuration file?
Release: 10.2-Spectrum-Device Based Suite-Server FOC
You can ask MySQL to show you the list of all locations where it searches for my.cnf (or my.ini on Windows). It is not an SQL command though. Rather, execute:
$ mysqld --help --verbose
In the very first lines you will find a message with a list of all my.cnf locations it looks for.
Default options are read from the following files in the given order:
Or, on Windows, default options are read from the following files in the given order: