A simple MySQL database import backup

Source: Internet
Author: User

Mission Objective: To import content from the current network database (mysql5.5,windows) into the test database (Mysql5.1,linux)

1. Because I am not familiar with MySQL, I first consider the solution is to use the ready-made database management tools to deal with. I have failed with navicat Premium and SQLyog. Each time the export succeeds, but there are always various error interrupts when importing.
2. A rough estimate of the failure may be due to
(1) version issue, but has been excluded.
(2) content caused, because the project surface is not all simple text data, which contains a large number of binary data, views, functions and trigger data need to be exported
(3) history is left garbled. Since the project was also modified by an old project extension. Some table structures are garbled in replication, making an error on import
3. Tool is not good, so I decided to use MySQL command to deal with
Export:
mysqldump.exe-uroot-proot--default-character-set=utf8--opt--extended-insert=false--triggers-r--hex-blob-x H Ouse >\x
Import
mysql>source/x
4. The table and data are normal when importing. However, the import custom function times log_bin_trust_function_creators error. Workaround is
Set Global log_bin_trust_function_creators = 1;
However, this method fails after a reboot, and the permanent solution is to modify the My.ini directly.
in [mysqld] plus Log_bin_trust_function_creators=1
5. Import successful, Task completed


since the test server has not been operated before, it is found that there are two MySQL services installed. Log in directly using the MySQL command is not what I want to use, so I need to find the Mysql.sock address of MySQL first
PS aux |grep mysqld
first look at the process to find the address--socket=/tmp/mysql.sock
mysql-uroot-p-p3306-s/tmp/mysql.sock
this will log in to the required MySQL. Problem solving.

A simple MySQL database import backup

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.