MySQL to INI Converter

Transform MySQL database dumps into INI configuration format

MySQL Input

Column to use as INI section name (must exist in your data)

INI Output

About MySQL to INI Converter

Convert MySQL database dumps (CREATE TABLE and INSERT statements) to INI configuration file format. Perfect for creating configuration files from database content or exporting settings data.

Key Features

  • Automatic Parsing: Extracts table structure and data from MySQL dumps
  • Flexible Section Names: Use a specific column or auto-generated row numbers as section names
  • Proper Escaping: Handles special characters and quotes values when needed
  • Comments: Includes metadata comments in the output
  • Standards Compliant: Generates valid INI format compatible with most parsers
  • File Upload: Upload .sql files directly

How to Use

  1. Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Configure Sections: Choose between row numbers or a specific column for section names
  3. Review Output: The INI configuration generates automatically
  4. Copy or Download: Use the Copy or Download button to save your INI file

Section Name Options

  • Row Numbers: Creates sections like [record_0], [record_1], [record_2]... (default)
  • Custom Field: Use a specific column (e.g., "id", "name") as the section name

Example Conversion

MySQL Input:

CREATE TABLE employees (
  id INT PRIMARY KEY,
  name VARCHAR(100),
  age INT,
  city VARCHAR(50)
);

INSERT INTO employees VALUES (1, 'John Doe', 28, 'New York');
INSERT INTO employees VALUES (2, 'Jane Smith', 34, 'London');

INI Output (using 'id' as section name):

; Generated from MySQL database dump
; Total records: 2

[1]
id=1
name=John Doe
age=28
city=New York

[2]
id=2
name=Jane Smith
age=34
city=London

INI Output (using row numbers):

; Generated from MySQL database dump
; Total records: 2

[record_0]
id=1
name=John Doe
age=28
city=New York

[record_1]
id=2
name=Jane Smith
age=34
city=London

INI Format Features

  • Sections: Each database row becomes an INI section [section_name]
  • Key-Value Pairs: Each column becomes a key=value pair
  • Comments: Lines starting with ; are comments (metadata)
  • Quoted Values: Values with spaces or special characters are automatically quoted
  • Escaped Characters: Special characters like \n, \t, \\ are properly escaped

Special Character Handling

The converter automatically handles special characters:

  • Spaces: Values with spaces are quoted: name="John Doe"
  • Newlines: Converted to \n
  • Tabs: Converted to \t
  • Backslashes: Escaped as \\
  • Quotes: Escaped as \"
  • Section Names: Special characters replaced with underscores

Common Use Cases

  • Configuration Files: Export database settings to INI config files
  • Application Settings: Create app configuration from database
  • Legacy Systems: Convert MySQL data for systems that use INI format
  • Deployment: Generate environment-specific config files
  • Backup: Export configuration data in portable INI format
  • Migration: Transfer settings between different systems

INI File Compatibility

The generated INI files are compatible with:

  • Python's configparser module
  • PHP's parse_ini_file() function
  • Java's Properties class
  • Node.js ini package
  • Windows INI file parsers
  • Most programming language INI libraries

Best Practices

  • Unique Sections: Use a column with unique values for section names (like ID or username)
  • Simple Keys: Column names should be simple alphanumeric identifiers
  • Avoid Duplicates: Ensure section names are unique to prevent data loss
  • Test Output: Verify the INI file with your target parser before deployment

Privacy & Security

All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.