A few days ago, I have to take my database dump which is in my local system and stored in MySQL, i tried from software tool phpMyAdmin but its take too much time and cannot succeed.
so i thought to restore my database by command line and use MySQL utility “mysqldump”.
I found its very easy and in less then a minutes its take all my databases dump.
To use it traverse to mysql bin directory.
C:\wamp\bin\mysql\mysql5.6.17\bin
to take dump there are various parameters with this command.
for a simple use type the following command
[code]mysqldump -u root -p dbname > C:dbdump1.sql[/code]
-u is a database user, -p is for password, dbname is your database name, “>” this tells mysqldump command to restore given database to this path “C:dbdump1.sql”.
Another example
[code]mysqldump -u[dbuser] -p[password] dbname > dump2.sql[/code]
Note: this give you an “Warning: Using a password on the command line interface can be insecure.”
All Database Dump:
if you want to take all of your database dump at on go, below is command
[code]mysqldump –all-databases –single-transaction –user=root > dump3.sql[/code]
if you have set any password for your database then include “–password=dbpassword” to the above command, this is again insecure.
Specify Databases:
include –databases <db1> <db2>, this allow you to take your specific databases dump
[code]mysqldump –databases db1 db2–single-transaction –user=root –password > dump4.sql[/code]
🙂
Precious Anmol liked this on Facebook.
Piyush Chaudhary liked this on Facebook.
Kamla Mahara liked this on Facebook.
Rohini Sah liked this on Facebook.
Rekha Digari Pandey liked this on Facebook.
Utkarsh Singh liked this on Facebook.
Alok Sah liked this on Facebook.
Manav Prakash Sah liked this on Facebook.
Pragya Raghav liked this on Facebook.