乐闻世界logo
搜索文章和话题

Where is MySQL's my.ini located on Windows?

1个答案

1

On Windows systems, the location of the my.ini configuration file can vary depending on the installation method and MySQL version. Typically, the following are common locations:

  1. The root folder within the MySQL installation directory. For example, if you installed MySQL at C:\Program Files\MySQL\MySQL Server 5.7\, the my.ini file may be located in this directory.

  2. Within the Windows system data directory. For some MySQL installations, the configuration file may be located in C:\ProgramData\MySQL\MySQL Server 5.7\. Note that the ProgramData folder is sometimes hidden, so you need to enable the option to show hidden files and folders in File Explorer.

  3. The user's application data folder. In some cases, the configuration file may be located in, for example, C:\Users\username\AppData\Roaming\MySQL.

To determine the exact location, you can use Windows Search to search for the my.ini file. Additionally, if the MySQL service is running, you can query the configuration file location via the command line. Open the Command Prompt and enter the following command:

sh
mysqld --help --verbose

This command outputs extensive information, including the path to the configuration file. You can look for the 'Default options' section to locate the specific path of my.ini or my.cnf.

The above are several methods to locate the my.ini configuration file for MySQL on Windows. I hope this helps!

2024年8月6日 23:57 回复

你的答案