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