A pure technical post after a long long time:)....This post gives a step by step procedure to back up your database or transfer your database from one system to other.I Googled for this topic and ended up getting 2 line code for this task...Here is the procedure to do it.
My assumptions:
MySql username: root
MySql password : root
Database name :dealer
Change the username,password and databases name for the database on your computer...
Step1:To create a backup of the database to be transferred(exported)
1.Run command prompt as administrator.To do this,navigate to Start-> All programs ->Accessories-> right click on 'Command Prompt' and select "run as administrator".
2.Make the path to be c:\ or any other drive.(Your backup will be stored in this path)
3.Type the following at the command prompt:
mysqldump -u username -ppassword databasename >backupname.sql
(no space between -p and password.)
For my database, the code would be :
mysqldump -u root -proot dealer >first.sql
4.It will prompt us to enter the password.Enter the Mysql password.
5.Once you are done with above steps successfully, you now have a backup of database in the path you provided( c:\ ) .The file name would be the name you gave as "backupname" in command.
Step2: To copy the database onto Mysql from backup:-
1.Copy the backup.sql file that you created to c:\( you can copy to any location.path has to provided if you use a different location)
2.Go to MySql Command line client and create a new database.Let us say 'deal'.
3.Run command prompt as administrator and execute the following code:-
mysql -u username -ppassword newdatabasename < backupname.sql
Here, the newdatabasename is the name of database that you created in the above step.
For my database ,it would be:-
mysql -u root -proot deal
4.On successful execution you have the database copied to the new database name.
The screenshots of steps are given below:-
