How MySQL exports a database

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.