Jakub Arnold Jakub Arnold - 1 year ago 136
MySQL Question

MySQL dump by query

Is it possible to do

by single
SQL query

I mean to dump the whole database, like
does when you do export to

Answer Source

not mysqldump, but mysql cli...

mysql -e "select * from myTable" -u myuser -pxxxxxxxxx mydatabase

you can redirect it out to a file if you want :

mysql -e "select * from myTable" -u myuser -pxxxxxxxx mydatabase > mydumpfile.txt

Update: Original post asked if he could dump from the database by query. What he asked and what he meant were different. He really wanted to just mysqldump all tables.

mysqldump --tables myTable --where="id < 1000"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download