38

following is the that I create dump from mysql database.

mysqldump -u root tempbkk > ttt.dump

but I want to create a dump that exclude one or more file while creating dump from database we select.What is the command for that ?

soulmerge
  • 73,842
  • 19
  • 118
  • 155
chetan
  • 3,175
  • 20
  • 72
  • 113

4 Answers4

46

mysqldump -u user -p some_database > some_database_dump.sql

Sagun Shrestha
  • 1,188
  • 10
  • 23
Eimantas
  • 48,927
  • 17
  • 132
  • 168
22

mysqldump can skip tables, you need the --ignore-table parameter. Check out the manual of mysqldump.

Jitesh Manglani
  • 495
  • 5
  • 12
soulmerge
  • 73,842
  • 19
  • 118
  • 155
1
mysqldump -u <user> -p<password> --databases <dbname> -r <NameofBackup.sql>
issac john
  • 88
  • 1
  • 1
  • 6
Kishore Guruswamy
  • 1,901
  • 1
  • 12
  • 5
  • Hi! Code only answers are considered low quality on SO; please consider adding an explanation to your code snippet as to improve it for OP and future visitors of the site. Thanks! – d_kennetz Apr 15 '19 at 18:52
  • 1
    Anyway as far as I can see this does not answer the question. – MandyShaw Apr 16 '19 at 07:40
1

Simply type this command mysqldump -u user -p database_name_in_database > name_of_file.sql

it will ask password for user. and there you go, your dumb file is ready. on same the location from where you run the command

Ali Raza
  • 673
  • 8
  • 19