Full export and import in mysql _ MySQL

Source: Internet
Author: User
Full export and import implementation method in mysql bitsCN.com helped the carp to transfer the database server to a large group buying website at noon yesterday. This article should have been summarized after the transfer was completed yesterday, but for some reason, I did not write it out in time. now I will try it out.
First, the environment is like this. in mysql 5.0, the centos system of the old database server has no web, no ftp, and the new database server mysql5.1 centos nginx.
The first idea of this environment is to use phpmyadmin for import and export, but the original database server does not have a web environment. In addition, the database file is about 300 MB, which cannot be imported only by phpmyadmin.
Prepare to stop mysql, package the Database Directory, and then overwrite the Database Directory of the new server, but the Carp tried to say that there was a problem with the table segment in the past, so this method also gave up.
Run the following command on the old server:

Mysqldump-u username-p database name> database name. SQL


Export. after the SQL file is compressed by zip, it is transferred to the new database server through another server ssh (scp, use the following statement to import data (you can use mysqldump-u username-p database name <database name. SQL but want to see the execution progress, so the following operations are executed)

Mysql-u root-p
Mysql> use database
Mysql> source/data0/tuan. SQL


In this way, there will be a lot of entries to import ssh. we recommend that you use ssh to execute the command on the windows Server. I use the company's network bandwidth to run 4 MB, occupying all my network speeds.
So far, the database transfer has let me get rid of it. there are not many technical things, but I just want to record it for myself to avoid forgetting and learn new things. BitsCN.com

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.