MySQL Remote Import Export database

Source: Internet
Author: User
Tags phpmyadmin

CD to D:\wamp\bin\mysql\mysql5.5.24\bin directory first
(Personal experience win+r->cmd->cd e:\wamp\bin\mysql\mysql5.5.24\bin->e:->mysqldump--default-character-set=gb2312- Hlocalhost-uroot-p phpjin>d:\test.sql)
Import: (Personal experience win+r->cmd->cd e:\wamp\bin\mysql\mysql5.5.24\bin->e:->mysql--default-character-set=gb2312- Hlocalhost-uroot-p phpjin<d:\test.sql)-Mi brother

Remote export:

Mysqldump-p [Port]-H [IP]-u [user]-P test>d:\test.sql

For example:

Mysqldump-p 3306-h 192.168.1.224-u root-p test>d:\test.sql

Remote import:

MYSQL-H[IP]-p[Port]-u[user]-P test<c:\test.sql

For example:

mysql-h 192.168.1.224-p 3306-u root-p test<c:\test.sql 

attached:
Remote Export database:     mysqldump-h [Hosname]-u[user_name]-p[password]--default-character-set=[char_set_name] [db_name] > [Save_path]
Span style= "margin:0px; padding:0px ">
  Example: then enter: Mysqldump-h119.12.12.11-umysql-pmysql123--default-character-set=utf8 Aspchina-- skip-lock-tables> d:\aspchina_net.sql

You can also: Mysqldump-h119.12.12.11-u mysql > D:\aspchina_net.sql

119.12.12.11 for the remote server ip,-umysql mysql for the database user name,-pmysql123 (no space interval) mysql123 for the user password, Set=utf8 to export the MySQL encoding format, Aspchina is the name of the database to be exported, >d:\aspchina_net.sql is the import to your local storage path, aspchina_net.sql you can freely name!

Remote Database import:

If the MySQL database is less than 2MB can be imported with mysqldump management tools, if the size of 2MB will not be, because the space provider provides phpMyAdmin management tools can generally only import less than 2MB of data, which makes some webmasters using MySQL database depressed!
Now let's teach you how to import data larger than 2MB using the mysqldump management tool.
1) Run->cmd in the lower left corner Start menu to enter the DOS command line status
2) D:\Program Files\mysql\mysql Server 5.0\bin> installs the MySQL installation directory for you, \ Bin for mysqldump management tool all in the directory;
3) then enter:mysql-h119.12.12.11-uaspchina-paspchina123456 aspchina< D:\aspchina_net.sql
Note: Aspchina_net.sql, if the user does not have the right to create a database will not be able to import the Aspchina_net.sql database, or spchina_net.sql can only be more than one table or will be wrong, remember!

Attached 2:
The remote connection command to apply MySQL can import and export data remotely, it is very convenient, and is not affected by the size of the phpMyAdmin 2M file, you can also specify data encoding, to ensure that the import data will not be garbled, the specific command is as follows:
Mysqldump--default-character-set=gb2312-h255.255.000.00-uroot-pxxxxxx Mydatabase>d:\data.sql

Where-H is followed by the IP address,-U is followed by the user name,-p followed by a password, MyDatabase is the database name, D:\data.sql is the exported data file, after the execution of the database obediently back to the local, using the scheduled task can even be used to backup the database regularly.

The following command is how to recover data, similar to the above:
MySQL--default-character-set=gb2312-h255.255.000.00-uroot-pxxxxxx mydatabase<d:\data.sql
After the execution of the database is restored, and generally will not be garbled.

MySQL Remote Import Export database

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.