.CNF

Файл CNF

MySQL Configuration File
Задать вопрос
БЫСТРЫЙ ОТВЕТ

A .cnf file is almost always a MySQL or MariaDB configuration file named my.cnf. It sets server and client options such as port, data directory, and buffer sizes. Open and edit it in a plain-text editor like Notepad++ or VS Code, and always back it up before making changes - a typo can stop the MySQL service from starting.

Разработчик: Oracle (MySQL) / MariaDB Foundation Категория: Файлы параметров Открыть стандартное MIME: text/plain
ОТКРЫВАЕТСЯ НА Windows macOS Linux
Связанные: .ICA · .DS_STORE · .WMZ · .CFG

На этой странице

Проиндексировано расширений: 19k+
Последняя проверка: Aug 21, 2026

Не знаете, что это за файл?

Перетащите любой файл в наш идентификатор - мы прочитаем первые байты, чтобы определить формат.

Идентифицировать файл

Что такое формат файла CNF?

.cnf is a configuration file associated with the MySQL relational database and its compatible fork MariaDB. .cnf files store database startup options in plain text, using an INI-style [section] key = value syntax. The canonical file is my.cnf, typically located in /etc/my.cnf or /etc/mysql/my.cnf on Linux and macOS systems. On Windows, the equivalent file is usually named my.ini.

.cnf files define database parameters such as buffer size, cache settings, character encoding, and network options. One of the most important settings is the wait_timeout parameter, which determines how long the server waits before closing an inactive connection - this is especially important for large databases and applications that use complex queries. Other directives control the InnoDB buffer pool, binary logging, and maximum connection limits.

MySQL reads option files from a documented set of paths in order, with settings in later files overriding earlier ones. The !include and !includedir directives allow splitting configuration across multiple .cnf files.

MySQL is the most popular relational database management system, widely used for websites, enterprise applications, and cloud deployments. It is free and open-source technology maintained by Oracle. MariaDB, a community fork, uses the same .cnf option-file syntax and is equally prevalent on Linux servers.

Безопасность и защита

РИСК: MEDIUM

The file is safe to read, but two real cautions apply. (1) Editing risk: an invalid option or typo in [mysqld] is a common cause of "MySQL won't start" - back up the file, change one option at a time, and validate before restarting. (2) Credential exposure: .cnf files (especially ~/.my.cnf) often store database usernames and passwords in clear text, so restrict file permissions (chmod 600) and never commit one to a public repository. Treat downloaded "optimized my.cnf" tuning files cautiously - verify the options suit your server's RAM and version.

Детали формата

в двух словах
ПОЛНОЕ НАЗВАНИЕMySQL Configuration Fileтакже известен как my.cnf, MySQL option file
РАЗРАБОТЧИКOracle (MySQL) / MariaDB Foundationс MySQL option files, mid-1990s (my.cnf on Unix; my.ini on Windows)
MIME-ТИПtext/plain
ТИПPlain-text INI-style option file ([section] key = value)
СТАНДАРТОткрытый · без роялти
СВЯЗАННЫЕ.ica.ds_store.wmz.cfg
Это расширение также используется в…
  • OpenVPN configuration / certificate file - Some OpenVPN and OpenSSL setups use .cnf for config or certificate-request settings (e.g. openssl.cnf).
  • MAME / arcade emulator config - MAME and some emulators write per-game .cnf settings files.
  • Generic application config - Various programs reuse .cnf as a plain-text settings file unrelated to MySQL.

Программы, открывающие файлы CNF

Windows3 apps
Notepad Открытый код Right-click > Edit with Notepad++ to read/edit the INI-style options with syntax help. Note: on Windows the file is often my.ini.
Visual Studio Code Бесплатно Open the .cnf to edit with INI highlighting; good for larger configs and includes.
MySQL Server / Workbench Бесплатно MySQL itself reads the .cnf at service start; Workbench's Options File editor exposes many settings via a GUI instead of hand-editing.
macOS3 apps
TextEdit Встроенная Open the .cnf, choose Format > Make Plain Text so it stays plain text when saving.
MySQL Server Бесплатно Reads /etc/my.cnf or ~/.my.cnf at startup (Homebrew installs vary the path).
Visual Studio Code Бесплатно Open the .cnf to edit with INI highlighting; good for larger configs and includes.
Linux3 apps
nano / vim Открытый код Edit in the terminal: sudo nano /etc/mysql/my.cnf - the usual way on servers. Back up first and restart mysqld to apply.
MySQL Server / MariaDB Открытый код The database engine reads the file on startup; validate with mysqld --validate-config (MySQL 8) before restarting.
GNOME Text Editor / gedit Открытый код Open the .cnf to read/edit on the desktop.

Технические подробности

глубокая спецификация
File formatPlain-text INI-style option file with no binary encoding
Syntax structureSection headers such as [mysqld] or [client] each containing key = value option lines
Character encodingASCII / UTF-8
Typical file size1 KB - 30 KB
Canonical filenamemy.cnf on Linux and macOS; my.ini on Windows (same syntax, different name)
Default search paths/etc/my.cnf, /etc/mysql/my.cnf, ~/.my.cnf - read in documented order; later file overrides earlier
Section groups[mysqld], [client], [mysqldump], [mysqld_safe], [mysql]
Include directives!include and !includedir let administrators split configuration across multiple files
Comment syntaxLines beginning with # or ;
Security considerationMay contain database passwords in plain text - protect with chmod 600 on Unix systems
MIME typetext/plain
File signatureNone - identified by INI-style section headers like [mysqld], not a binary byte signature
Compatible productsMySQL 5.x / 8.x and MariaDB 10.x / 11.x - both use identical option-file syntax
Key options configuredinnodb_buffer_pool_size, wait_timeout, max_connections, character-set-server, bind-address
CompressionNone - always stored as uncompressed plain text
DeveloperOracle Corporation (MySQL) and the MariaDB Foundation
ВыпущенMySQL option files, mid-1990s (my.cnf on Unix; my.ini on Windows)
Последняя версияOngoing - same INI option-file syntax across MySQL 8.x and MariaDB 11.x
Открыть стандартноеДа · без роялти
Спецификацияdev.mysql.com

Конвертации CNF

Вопросы и ответы сообщества

спрошено пользователями
Задать быстрый вопрос
Получите помощь от людей, работающих с файлами CNF. Будьте конкретны - укажите вашу систему и версию ПО.
Аккаунт не нужен · ответы обычно в течение дня

Вопросов пока нет - станьте первым, кто спросит о файлах CNF.

Часто задаваемые вопросы

What is a .cnf file?
In MySQL/MariaDB it's the configuration ('option') file, usually named my.cnf, that sets server and client options like port, data directory, buffer sizes, and default character set. It's plain text in INI format.
How do I open and edit a .cnf file?
Open it in a plain-text or code editor - Notepad++ or VS Code on Windows, nano/vim on Linux servers (sudo nano /etc/mysql/my.cnf), TextEdit (plain text) on Mac. Back up first, then restart the MySQL service to apply changes.
Where is the MySQL my.cnf file located?
Common locations are /etc/my.cnf, /etc/mysql/my.cnf, and ~/.my.cnf on Linux/macOS; on Windows it's usually my.ini in the MySQL data or install directory. Run 'mysqld --help --verbose' to see the search order.
Why won't MySQL start after I edited my.cnf?
Almost always an invalid or misspelled option, or an option not supported by your server version. Restore your backup, or comment out the last change; on MySQL 8 run 'mysqld --validate-config' to find the offending line.
What's the difference between my.cnf and my.ini?
None in format - both are the same INI-style MySQL option file. my.cnf is the Unix/Linux/macOS name; my.ini is the Windows name.
Is it safe to store my password in .my.cnf?
It's convenient for command-line tools but the password is in clear text. Restrict permissions (chmod 600 ~/.my.cnf) so only your user can read it, and never share or commit the file.

Ссылки

1MySQL Reference Manual - Using Option Filesdev.mysql.com
2MariaDB - Configuring MariaDB with option filesmariadb.com

Узнать больше

по всей базе данных

Популярные расширения на этой неделе

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.EXEWindows Executable (Portable Executable)
4.PARTPartial Download File
5.BINCD/DVD Disc Image (BIN/CUE)
6.DATProgram Data File (generic)
7.RPMSGRestricted Permission Message
8.MDMarkdown Document
9.TXTPlain Text File
10.NOMEDIAAndroid No-Media Marker File

Похожие расширения

.ICACitrix Independent Computing Architecture file
.DS_STOREmacOS Finder Desktop Services Store (.DS_Store)
.WMZWindows Media Player Skin
.CFGConfiguration File
.LICLicense File
.CONFConfiguration File

Бесплатные инструменты для файлов

Идентификатор файлов и конвертер изображений в браузере - все работает на вашем устройстве.

Открыть инструменты

Обзор расширений файлов A-Z