Today, we exported a data file. SQL using phpmyadmin. Now we want to remotely import the data to the database, and the Unknowncommand error occurs. Baidu has a solution. For details, refer.
Today, we exported a data file. SQL using phpmyadmin. Now we want to remotely import the data to the database and the Unknown command error occurs. Later, Baidu has a solution. For details, refer.
The Code is as follows: |
|
# Mysqldump forum> forum. SQL-u root-p
|
Export a 2.4G large forum. SQL file and try to import another machine on the Intranet (192.168.0.8 ).
The Code is as follows: |
|
# Mysql forum Enter password: ERROR at line 1410: Unknown command '['. |
Baidu learned a simple way to replicate databases between servers.
The Code is as follows: |
|
Mysqldump-hhost1 xx | mysql-hhost2 |
Export xx from host1 and write it to host2.
If not two identical servers, we can refer to the following method:
Remote database server operating system is Linux, OS default character set is UTF-8, but I use Windows 7, the default character set is GBK, add-default-characgter-set = utf8 during import.
The complete import and export statement is attached.
The Code is as follows: |
|
Mysqldump-udbuser-p database table> exp. SQL; Mysql-udbuser-p-default-character-set = utf8 database <exp. SQL |
When mysql is imported
The Code is as follows: |
|
Mysql-u root-p |
Similarly, if the database is gbk
The Code is as follows: |
|
Mysql-u root-p |