To backup the Database:
mysqldump –u[Username] –p[Password] --database [DatabaseName] > D:\DBBackup.sql
To take backup with all the Databases :
--all-databases :- use to take backup all DataBases
mysqldump –u[Username] –p[Password] --all-databases > D:\DBBackup.sql
To take backup with Stored procedures, functions, triggers, views :
--routines :- Use to take backup with all Stored procedures, functions, triggers, views.To take backup from the different system:
–h[IP Address]:- use to take backup from different machine.
mysqldump –u[Username] –p[Password] –h[IP Address] --database [DatabaseName] > D:\DBBackup.sql
To take backup with only tables structure:
--no-data :-Use to take backup with out tables data.
mysqldump –u[Username] –p[Password] --no-data --database [DatabaseName] > D:\DBBackup.sql
To take backup with only tables data (without table structures):
--no-create-info :- use to take backup with tables data only.
mysqldump –u[Username] –p[Password] --no-create-info --database [DatabaseName] > D:\DBBackup.sql
To drop the Database:
-f :- use to drop Database forcibly in case any sql error happen in middle.
mysqldump –u[Username] –p[Password] –h[IP Address] -f drop [DataBaseName]
To create the DataBase:
mysqldump –u[Username] –p[Password] –h[IP Address] create [DataBaseName]
To restore the DataBase:
mysql –u[Username] –p[Password] –h[IP Address] -f [DataBaseName] < D:\DBBackup.sql
Here also we can use ‘–f’ to restore the Database forcibly in case if any sql error occur.
4 comments:
Good tutorial!
It's a pity you don't have a donate button! I'd without a doubt donate to this fantastic
blog! I suppose for now i'll settle for bookmarking and adding your
RSS feed to my Google account. I look forward to new updates and will share this
website with my Facebook group. Chat soon!
When someone writes an paragraph he/she retains the
image of a user in his/her brain that how a user can know
it. Thus that's why this article is outstdanding. Thanks!
I am a decade old, So this game is very problematic for me.
I got as much as the last section by myself in 2 trys.
Respects for your's Questions & Opinions