MySQL Export Import Description _ Extraterrestrial Virtual Host

Source: Internet
Author: User
Tags mysql code mysql in create database phpmyadmin
Necessary knowledge:
MySQL Code:
In the MySQL installation directory, such as:
E:\Program Files\mysql\mysql Server 5.0\my.ini
You can find the code for the MySQL library, which in most cases can be set to uft-8:
Default-character-set=utf8
or GBK:
Default-character-set=gbk
If the encoding is incorrect, it will cause the import to fail. The database will not take effect until the encoding is modified.

1. Condition: On the same server,
MySQL database can be exported with the platform of the import function normal backup and restore.

2. Conditions: On different servers, in the case of My.ini coding,
MySQL database can be exported with the platform of the import function normal backup and restore.

2. Conditions: On different servers, in the case of inconsistent my.ini coding,
My.ini must be modified to become a consistent encoding, the MySQL database can use the platform's export import function normal backup and restore.

3. For files imported with phpMyAdmin or other tools, you will need to process them again before you can use the platform's import function:
Take phpMyAdmin as an example, after exporting, save the generated SQL statement as a. sql file, and then modify it with Notepad:

(1) Locate the line at the beginning of the CREATE database as:

CREATE database ' db name ' DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Precede with--symbol, cancel the run of this line (because import is imported with normal user angle, do not allow database to be established)

This makes it possible to import using the platform's import functionality.

(2) You can then see if the encoding of this library is consistent with your server

If the code is inconsistent, then the
<1> either use Phpmymyadmin to back up the encoded. sql file to import. (The first page of phpMyAdmin landing can be selected for encoding)
<2> either modify the encoding in My.ini and restart MySQL in order to import (restart MySQL on the server, management tools, service management, restart), this way a higher chance of success, it is recommended that the operation.


-----Note that if the import fails due to incorrect encoding, you will need to point out the database for the next import (the master version after 2007-6-12 has a clear feature in the database panel)------


To Discuz forum for the fall
If the GBK version of the forum was installed then,
After exporting with phpMyAdmin, the encoding is GBK,
To import another server, you must set the My.ini to: DEFAULT-CHARACTER-SET=GBK and restart MySQL before you can import it on the platform.
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.