Exporting MySQL tables and databases

Here are the ways you can export tables and databases, each of them have their advantages and disadvantages depending on the task at hand. We will list out each with examples and discuss them. We will assume that the database name is D and table name is T. Going native with SQL and generating an csv from the MySQL console Assuming that you are already logged into your mysql console using say mysql -u -p replace with your username replace with your database You can use the following command to generate an csv of pretty much any SQL....

January 9, 2013 · 2 min · 319 words · Me

Gotcha with exporting MySQL tables for windows

I encountered some interesting issues when pulling out CSV from my MySQL databases. The core issue was the csv generated was not seemingly compatible with the various spreadsheet readers in Windows. After having a closer look at the file, it turns out to be an encoding issue clearly. As the database was Latin1 encoded, the carriage return was handled as r [shows up as ^M on VI] in some text blobs....

January 9, 2013 · 1 min · 137 words · Me