How do I know which configuration file is used by MySQL currently? Is there any command or something to find it out?
相关问题
- Is shmid returned by shmget() unique across proces
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- how to get running process information in java?
- MySQL: conduct a basic search
login to mysql with proper credential and used mysql>SHOW VARIABLES LIKE 'datadir'; that will give you path of where mysql stored
You should find them by default in a folder like
/etc/my.cnf
, maybe also depends on versions. From MySQL Configuration File:There are a few switches to package managers to list specific files.
RPM Sytems:
There are switches to
rpm
command,-q
for query, and-c
or--configfiles
to list config files. There is also-l
or--list
The
--configfiles
one didn't quiet work for me, but--list
did list a few.cnf
files held bymysql-server
DEB Systems:
Also with limited success:
dpkg --listfiles mysql-server
mysqld --help --verbose will find only location of default configuration file. What if you use 2 MySQL instances on the same server? It's not going to help.
Good article about figuring it out:
"How to find MySQL configuration file?"
You can use the report process status
ps
command:The information you want can be found by running
or
I tried this command on my machine:
And it printed out:
See if that works for you.
If you are using terminal just type the following: