Why is the my.cnf file on the server incomplete or has very few entries?

Ledgemonkey picture Ledgemonkey · Jan 4, 2012 · Viewed 8.9k times · Source

I have accessed a clients server (plesk) via ssh to view/edit the my.cnf and php.ini files if i view them using vi the file seem to be virtualy empty of entries ? see screenshot.

Not sure whether this is an access issue or the files are the right files any help would be appreciated

Thanks

enter image description here

Answer

Marki555 picture Marki555 · Jan 4, 2012

As Rup already mentioned in his comment, the my.cnf file contains only these few lines. It is completely fine, mysql server is able to start also without any config file - in that case it uses the defaults plus whatever is on the commandline. To see what config files mysqld reads and what defaults it uses, just run:

mysqld --verbose --help

and it will produce report containing for example this:

mysqld  Ver 5.0.51a-24-log for debian-linux-gnu on x86_64 ((Debian))

Default options are read from the following files in the given order:
/etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf

The following groups are read: mysql_cluster mysqld server mysqld-5.0

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- -----------------------------
help                              TRUE
...
wait_timeout                      3600

To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.