Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does mysql use if there is no my.cnf?

Tags:

mysql

my.cnf

In short, what configuration values does MySQL use if there is no my.cnf?

I'm running MySQL on Slackware. I've been using it for a while with ISAM and InnoDB tables. I never configured a my.cnf file. Oops. Now I'd like to do that, but I don't know what settings it is using currently, and I'd like to know before I install a my.cnf file and possibly change things.

I've done MySQL --help and checked the locations given.
I've done find / and I'm certain there is no my.cnf or .my.cnf file anywhere.
I've done ps aux and no --defaults_file is being specified.

These files exist:

/etc/my-medium.cnf
/etc/my-huge.cnf
/etc/my-small.cnf
/etc/my-large.cnf

/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf

like image 549
Charles Avatar asked Jan 26 '11 18:01

Charles


1 Answers

If it can't find a my.cnf or my.ini file, MySQL will use its compiled-in defaults. The .cnf/.ini files are not necessary unless you want to override those defaults.

The medium/huge/small/large files you found are suggested setups for that "size" of server. Just pick the one in /etc that suits your needs and rename it to my.cnf (in the same directory), restart mysql, and it should make that configuration take effect.

like image 128
Marc B Avatar answered Oct 02 '22 09:10

Marc B