MySQL copy command for different database with host

Source: Internet
Author: User
Tags mysql command line

MySQL copy command for different databases with host: Note running in terminal, not running on the MySQL command line.
--add-drop-table | MySQL portal_optimize-u root-ppassword1$

During the copy process, the following error occurred:

1 ERROR1153 (08S01) at line1160:got a packet bigger than'max_allowed_packet' bytes 2 mysqldump:got errno on write     

Need to enlarge the max_allowed_packet in my.cnf, my machine defaults to 1M, zoom to 32M. Restart MySQL.

Ok. The above scheme is suitable for databases with small data volumes. Here is a large capacity (1G or more).

1  --Quick Portal_dev | gzip > Portal_DEV.contents.gz 

Through the above command, the Portal_dev database is directed into Portal_DEV.contents.gz compressed file.

-ppassword portal_optimize

Then, with the above command, import the Portal_dev into the Portal_optimize database.

Perfect, it ' s done!!!

MySQL copy command for different database with host

Related Article

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.