1

I have read this article but I can not find /etc/my.cnf file/folder. I have mysql-5.6.26-win32. Which version of MySQL I have to download for editing this file?

2 Answers 2

1

Since you're on Windows, look in %PROGRAMDATA%\MySQL\MySQL Server 5.6. It may also be called my.ini.

If you don't see it in there, reference the table of locations on https://dev.mysql.com/doc/refman/5.6/en/option-files.html

0

The my.cnf isn’t always in the same location on different systems. And MySQL also might load a few different my.cnf files when it starts up.

So the best way to determine which my.cnf is being used is to run this command from the command line:

mysql --help

Now that will basically spit out a wall of text of MySQL configuration options, but look for a chunk of text near the middle that reads something like this; taken from an Ubuntu 12.04.5 server but the concept is the same:

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

The paths /etc/my.cnf, /etc/mysql/my.cnf, /usr/etc/my.cnf and ~/.my.cnf show the order in which different MySQL config files are loaded.

Now check each location to see which one is the main my.cnf your setup uses and just edit and adjust that file as you see fit. Save it, restart MySQL and the edits and adjustments should be in place.

Addendum for Linux/Unix users who need to figure out where their my.cnf files are.

And while it seems you are on a Windows system, if you are on a Linux/Unix system you can pipe that output through grep to make your life easier like this:

mysql --help | grep -A 1 "Default options"

The results should be just this:

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

Which is of course easier to find/understand than going through a wall of MySQL configuration options.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .