web stats
Tool: How to Analyze Mysql Database Schema | Why Cloud Computing

Tool: How to Analyze Mysql Database Schema

Recently, I was asked to make a database transfer from one server (lets call the database as db1 and server as db-server1) to the new database on another server (lets call the new database as db2 and the server as db-server2) on every update done on a certain table in the first database (db1). Both the databases are functional and both of them have same schema which I am not aware of.

Share our stuff and help us grow. Need help to create something new or fix something old? Contact us to know if we can help 🙂

Since I am new to this database stuff, I just took the database schema of mysql db1 database without taking the overall backup of the database. The following mysql statement helps you take the backup of just mysql schema.

mysqldump -d -u username -p mysqldatabasename > mysqldatabasename.sql

In the above example, username is your mysql username, mysqldatabasename is the name of your mysql database name. mysqldatabasename.sql is the file where your output is saved.

Now, once I have the database schema up and running its time for me to analyze it. I have searched around for different opensource applications and tried them on windows 7 machine and most of them failed. Finally, I managed to install mysql workbench which is a free tool to do all the stuff I wanted to do.

I have installed a local version of mysql on my local machine and imported the mysqldatbasename.sql database to local database. Later, I used mysql workbench to reverse engineer the database to get proper understanding of the database before I started coding the automation scripts to export new database entries on database db1 from old server db-server1 to new database (db2) on another server db-server2.

So, I hope this document helped. If you have any questions please don’t hesitate to leave your comments below.

Share our stuff and help us grow. Need help to create something new or fix something old? Contact us to know if we can help 🙂

Related Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *

Why ask?