.CNF

CNF File

MySQL Configuration File
Ask a question
QUICK ANSWER

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.

Developer: Oracle (MySQL) / MariaDB Foundation Category: Settings Files Open standard MIME: text/plain
OPENS ON Windows macOS Linux
Related: .ICA · .DS_STORE · .WMZ · .CFG

On this page

19k+ extensions indexed
Last reviewed Aug 21, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the CNF file format?

.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.

Security & safety

RISK: 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.

Format details

in a nutshell
FULL NAMEMySQL Configuration Fileaka my.cnf, MySQL option file
DEVELOPEROracle (MySQL) / MariaDB Foundationsince MySQL option files, mid-1990s (my.cnf on Unix; my.ini on Windows)
MIME TYPEtext/plain
TYPEPlain-text INI-style option file ([section] key = value)
STANDARDOpen · royalty-free
This extension is also used by…
  • 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.

Programs that open CNF files

Windows3 apps
Notepad Open-source 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 Free Open the .cnf to edit with INI highlighting; good for larger configs and includes.
MySQL Server / Workbench Free 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 Built-in Open the .cnf, choose Format > Make Plain Text so it stays plain text when saving.
MySQL Server Free Reads /etc/my.cnf or ~/.my.cnf at startup (Homebrew installs vary the path).
Visual Studio Code Free Open to edit with highlighting; safer than TextEdit for structured config.
Linux3 apps
nano / vim Open-source 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 Open-source The database engine reads the file on startup; validate with mysqld --validate-config (MySQL 8) before restarting.
GNOME Text Editor / gedit Open-source Open the .cnf to read/edit on the desktop.

Technical details

deep spec
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
ReleasedMySQL option files, mid-1990s (my.cnf on Unix; my.ini on Windows)
Latest versionOngoing - same INI option-file syntax across MySQL 8.x and MariaDB 11.x
Open standardYes · royalty-free
Specificationdev.mysql.com

CNF conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with CNF files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about CNF files.

Frequently asked questions

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.

References

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

Keep exploring

across the database

Top extensions this week

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

Related extensions

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

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z