Dumping MySQL Tables into Separate Files

This bit of shell wizardry is particularly handy if you have to upload to a phpmyadmin installation with a limited file size:

for x in `mysql --skip-column-names -u [username] -p[password] [dbname] -e 'show tables;'`; do
     mysqldump -u [username] -p[password] [db name] $x > "$x.sql"

Source – http://stackoverflow.com/questions/9359053/mysqldumper-dumping-each-table-separately

Getting database model code using peewee’s pwiz

One of the great things I love about peewee is it’s ability to generate a Python database model from an existing database:

C:\Users\joel\git>python -m pwiz -e mysql -u root -P vagrant -H -p 13306 test_1 -t coa

from peewee import *

database = MySQLDatabase('test_1', **{'host': '', 'password': 'va
grant', 'port': 13306, 'user': 'root'})

class UnknownField(object):

class BaseModel(Model):
class Meta:
database = database

class Coa(BaseModel):
account = CharField(db_column='Account', null=True)
accountno = CharField(db_column='AccountNo', null=True)
activestatus = CharField(db_column='ActiveStatus', null=True)
banknonote = CharField(db_column='BankNoNote', null=True)
job = IntegerField(db_column='job_id', null=True)
code = CharField(db_column='Code', null=True)
description = CharField(db_column='Description', null=True)
taxline = CharField(db_column='TaxLine', null=True)
type = CharField(db_column='Type', null=True)

class Meta:
db_table = 'coa'

MySQL for Excel


MySQL for Excel is an Excel Add-In that is installed and accessed from within Microsoft Excel’s Data tab, offering a wizard-like interface to help users browse MySQL Schemas, Tables, Views and Procedures and perform data operations.

Be sure in install the Visual Studio 2010 Tools for Office Runtime before running the MySQL for Excel installer.

Source: http://dev.mysql.com/doc/mysql-for-excel/en/mysql-for-excel-install.html