Mysql tutorial how to export a database tutorial
This article has added to my favorites most of the methods for exporting databases from mysql. A friend sent an email yesterday asking me how to export the database from mysql. Below we have summarized some methods for importing the database.
Although not original, it is a summary.
Go to cmd (note that in OS cmd, instead of mysql)
==============================
1. Export the database (SQL script)
Mysqldump-u username-p Database Name> exported file name
Mysqldump-u root-p db_name> test_db. SQL
2. mysql exports a database 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 2
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 username-p database name <database name. SQL
Method 3: If you have server Permissions
(1) directly copy database directories and files
Method 4
Php tutorial myadmin Tool
Select "structure" and "data" to export. Do not add the "drop database" and "drop table" options.
Select the "Save As file" option. If you have more data, select the "gzipped" option.
Save the exported SQL file.