Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL my.ini location

I have already seen http://dev.mysql.com/doc/refman/4.1/en/mysql-config-wizard-file-location.html

how to know mysql my.cnf location

and

http://dev.mysql.com/doc/refman/5.1/en/option-files.html

But I am still stuck with the ages old question! "Where is my my.ini" I am using windows server 2008 with mysql 5.5.28. I installed the service using mysqld --install and I am able to use the mysql server using sqlyog. But unfortunately I am not able to find my.ini in installation directory or not in c:\ neither in c:\windows nor in data_dir query show variables like "mysql_home" returned nothing as well.

Any suggestions?

like image 211
Sap Avatar asked Jan 30 '13 06:01

Sap


People also ask

Where is the my ini file in MySQL 8?

For MySql Server 8.0 The default location is %WINDIR% or C:\Windows.

Where is MySQL ini file in Windows?

ini file. The default data directory location is C:\Program Files\MySQL\MySQL Server 5.7\data , or C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. The C:\ProgramData directory is hidden by default.

How do I change my ini file in MySQL?

Right click on NotePad, and select "Run as Administrator" Then from NotePad open the MySQL my. ini file. Make edits as needed, and save.


1 Answers

my.ini LOCATION ON WINDOWS MYSQL 5.6 MSI (USING THE INSTALL WIZARD)

Open a Windows command shell and type: echo %PROGRAMDATA%. On Windows Vista this results in: C:\ProgramData.

According to http://dev.mysql.com/doc/refman/5.6/en/option-files.html, the first location MySQL will look under is in %PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini. In your Windows shell if you do ls "%PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini", you will see that the file is there.

Unlike most suggestions you will find in Stackoverflow and around the web, putting the file in C:\Program Files\MySQL\MySQL Server 5.6\my.ini WILL NOT WORK. Neither will C:\Program Files (x86)\MySQL\MySQL Server 5.1. The reason being quoted on the MySQL link posted above:

On Windows, MySQL programs read startup options from the following files, in the specified order (top items are used first).

The 5.6 MSI installer does create a my.ini in the highest priority location, meaning no other file will ever be found/used, except for the one created by the installer.

The solution accepted above will not work for 5.6 MSI-based installs.

like image 189
amateur barista Avatar answered Sep 20 '22 23:09

amateur barista