create dump file from database in mysql

74,601

Solution 1

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

Solution 2

mysqldump -u user -p some_database > some_database_dump.sql

Solution 3

mysqldump -u <user> -p<password> --databases <dbname> -r <NameofBackup.sql>

Solution 4

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

Share:
74,601
chetan
Author by

chetan

Updated on November 09, 2021

Comments

  • chetan
    chetan over 2 years

    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 ?

  • d_kennetz
    d_kennetz about 5 years
    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!
  • MandyShaw
    MandyShaw about 5 years
    Anyway as far as I can see this does not answer the question.
  • MandyShaw
    MandyShaw about 5 years
    I can't see that this answers the question.
  • Sagun Shrestha
    Sagun Shrestha over 4 years
    should be mysqldump -u user -p some_database > some_database_dump.sql