An error occurred while importing the. SQL file using mysqldump.

Source: Internet
Author: User
Tags sql using
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

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.