PHPackages                             mrmarkfrench/mysql-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mrmarkfrench/mysql-converter

ActiveLibrary[Database &amp; ORM](/categories/database)

mrmarkfrench/mysql-converter
============================

A quick-and-dirty tool for converting raw MySQL query output to CSV.

1.0.1(8y ago)198MITPHPPHP &gt;=5.0.0

Since Jul 31Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mrmarkfrench/mysql-converter)[ Packagist](https://packagist.org/packages/mrmarkfrench/mysql-converter)[ Docs](https://github.com/mrmarkfrench/mysql-converter)[ RSS](/packages/mrmarkfrench-mysql-converter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

mysql-converter
===============

[](#mysql-converter)

A quick-and-dirty tool for converting raw MySQL query output to CSV.

What it's for
-------------

[](#what-its-for)

This tool is intended as a quick way to convert raw MySQL query output to CSV without requiring a lot of manual manipulation of the data in a text editor. It does a reasonable job of handling cases where the data contains line breaks, commas, copies of the field delimiter character, different line ending character(s) than the file as a whole, etc. In general, if your data is more-or-less clean, the tool will get the job done.

That said, the tool only goes so far. Particularly if the data in your query result is user-supplied, there are no guarantees in life. The tool will do its best to sort things out, but there will be some cases where it simply isn't able to sort out where one field ends and the next begins, and in those cases it will throw an exception and you'll need to go clean up your data before you can continue.

What this is NOT
----------------

[](#what-this-is-not)

This tool is *not* the best choice if you have filesystem access to your MySQL server. In that case, MySQL already provides tools to output CSV, and will do a much better job of dealing with particularly gnarly data than this tool. If you have access to the filesystem on your MySQL server, check the `SELECT ... INTO OUTFILE` syntax in the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/ "MySQL documentation").

A word of caution
-----------------

[](#a-word-of-caution)

In most cases, you will be converting data to CSV so that you can import it into a spreadsheet somewhere. There are some values that a malicious user might have placed into your database which while both MySQL and this tool will handle them without incident, might cause Excel to execute possibly dangerous and arbitrary code if the data is imported with macros and VB scripting turned on.

**You should never import user data into Excel with these features enabled**. This tool makes no attempt to detect or remove such content. Your users are almost certainly terrible people and shouldn't be trusted. ***Proceed at your own risk***.

Quickstart
----------

[](#quickstart)

```
curl -s http://getcomposer.org/installer | php

echo '{
	"require": {
		"mrmarkfrench/mysql-converter": "*"
	}
}' > composer.json

php composer.phar install

./example example.txt example.csv

```

Contributions
-------------

[](#contributions)

Please feel free to fork this repository and add new features as necessary. The existing functions should give you a solid framework to build on, and your pull requests are welcome.

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3204d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7f589da50aeea0b613da57f35dc1910eb90c3136854482fb9fffce5b5151823?d=identicon)[mrmarkfrench](/maintainers/mrmarkfrench)

---

Top Contributors

[![mrmarkfrench](https://avatars.githubusercontent.com/u/865255?v=4)](https://github.com/mrmarkfrench "mrmarkfrench (7 commits)")

---

Tags

mysqlcsv

### Embed Badge

![Health badge](/badges/mrmarkfrench-mysql-converter/health.svg)

```
[![Health](https://phpackages.com/badges/mrmarkfrench-mysql-converter/health.svg)](https://phpackages.com/packages/mrmarkfrench-mysql-converter)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k25.2M34](/packages/kirschbaum-development-eloquent-power-joins)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M35](/packages/scienta-doctrine-json-functions)[cytopia/mysqldump-secure

Secure mysqldump script with encryption, compression, logging, blacklisting and Nagios monitoring integration

1474.7k1](/packages/cytopia-mysqldump-secure)[pmatseykanets/artisan-io

Artisan data import command for Laravel

172.0k](/packages/pmatseykanets-artisan-io)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
