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
Author by
chetan
Updated on November 09, 2021Comments
-
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 about 5 yearsHi! 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 about 5 yearsAnyway as far as I can see this does not answer the question.
-
MandyShaw about 5 yearsI can't see that this answers the question.
-
Sagun Shrestha over 4 yearsshould be
mysqldump -u user -p some_database > some_database_dump.sql