Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql : dump database along data

Tags:

sql

mysql

dump

I want to dump my database along the table schema and the table data also using the unix command line .

I used .

mysqldump -d -u root  -p frontend > frontend.sql 

But above command is dumping only schema not the data from the database .

Please help me out how can i dump the database along the data also.

like image 771
masterofdestiny Avatar asked Dec 24 '12 15:12

masterofdestiny


People also ask

How do I dump a MySQL database?

To dump/export a MySQL database, execute the following command in the Windows command prompt: mysqldump -u username -p dbname > filename. sql . After entering that command you will be prompted for your password.

How do I dump multiple databases in MySQL?

To backup multiple MySQL databases with one command you need to use the --database option followed by the list of databases you want to backup. Each database name must be separated by space. The command above will create a dump file containing both databases.

Which flag allows you to dump all the database table entries?

To dump large tables, you could combine the following two flags, --single-transaction and --quick .


1 Answers

backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql 

This will do,

If your requirement is to dump data alone then go for this,

To export to file (data only)

mysqldump -u [user] -p[pass] --no-create-db --no-create-info mydb > mydb.sql 
like image 130
Mari Avatar answered Oct 04 '22 00:10

Mari