This article mainly describes the actual operation process of MySQL Database Import and Export. We use instances to introduce the actual operation steps, if you are interested in the actual operations, you can browse the following articles. Hope you will have some gains.
1. Export the entire database
MySQLdump-u username-p Password Database Name> exported file name
- MySQLdump -u jason -p jason roomdatadb> roomdatadb.sql
2. Export a table
MySQLdump-u user name-p Password Database Name Table Name> exported file name
- MySQLdump -u jason -p jason roomdatadb t_roomdata> t_roomdata.sql
3. Export a database structure
- MySQLdump -u jason -p jason -d --add-drop-table roomdatadb> d:\roomdatadb.sql
-D no data -- add-drop-table adds a drop table before each create statement.
4. Import the database
Common source commands
Go to the MySQL Database Console,
For example, MySQL-u root-p
MySQL> use Database
Then run the source command. The following parameter is the script file, as shown in. SQL)
- MySQL>source d:\wcnc_db.sql
See MySQL Data Import tool: MySQLdump
The above content is an introduction to the import and export of MySQL databases. I hope you will have some gains.
The above content is the description of MySQL Database Import and Export, hoping to help you in this regard.
Original article title: MySQL Database Import and Export
Connection: http://www.cnblogs.com/jason-one/archive/2009/03/13/1410778.html