MySQL tutorial how to export a database tutorial
This article collects most of the web site about MySQL Export database method, because yesterday a friend sent an e-mail to ask me how MySQL exported the database, the following we summarized a number of ways to import the database.
Although not original, but also be summed up.
Enter cmd (note in OS cmd instead of MySQL)
===================
1. Export database (SQL script)
Mysqldump-u user name-p database name > exported file name
Mysqldump-u root-p db_name > Test_db.sql
2.mysql Export Database A table
Mysqldump-u user name-P database name Table name > exported file name
Mysqldump-u wcnc-p test_db users> test_users.sql (no semicolon at the end)
Experience Two
Dynamic MySQL Service
/etc/init.d/mysql start
Export the entire database
Mysqldump dbname > C:mydb.sql-u root-p
Import Database
SOURCE Mydb.sql
Mysql-u user name-p database name < database name. sql
Method Three if you have server permissions
(1) Direct copy of database directories and files
Method Four
PHP Tutorials MyAdmin Tools
Export options, select export structure and data, and do not add drop database and drop table options.
Select the Save As File option to select the gzipped option if the data is more numerous.
Save the exported SQL file.