# example 1: I need to back up a database named Test, the root password of my database is Redhat. Mysqldump-uroot-predhat Test > test.sql# Reviews: The default mysqldump command (without any parameters) can only back up views, all tables, and data in the database. A generally sound database will contain stored procedures, functions, triggers, and events, and if you want the information to be saved when you back up the database, you need to add additional parameters to do so. -d The function of this parameter is to not save the data. # example 2: I need to back up a database named Test, the root password of my database is Redhat. I just need the structure. mysqldump-d-uroot-predhat Test > test.sql# Reviews: Sometimes we just need to use the data structure of a database, so we can take this parameter. The function of the-t parameter is to export only the data. # example 3: I need to export the data from the ABC table named Test database, the root password of my database is Redhat. Mysqldump-t-uroot-predhat Test > test.sql# Reviews: This parameter is typically used to export data from a table. --add-drop-database the function of this parameter is to add a judgment statement at the time of backup and delete if the target database already exists. --add-drop-table the function of this parameter is to add a judgment statement at the time of backup and delete if the target table already exists.
This article is from the "Last Night Stars" blog, please make sure to keep this source http://yestreenstars.blog.51cto.com/1836303/1680148
Mysqldump Common parameters