Phpmyadmin database import and export problems

Source: Internet
Author: User
In the background, I found that a function was invalid and various detection methods were used. then I detected that a table in the database was accidentally deleted. I backed up the data and downloaded it from the google browser, after the original data is replaced, it will be replaced, and the import will be incorrect. you may find SQL scores... in the background, I found that a function was invalid and various detection methods were used. then I detected that a table in the database was accidentally deleted. I backed up the data and downloaded it from the google browser, after the original data is replaced, it will be replaced, and the import will be incorrect.

You may have discovered SQL analyzer bugs. Please carefully check your query, including whether the quotation marks are correct and match. Other possible causes of failure may be because you have uploaded binary data beyond the referenced text area. you can also try your query on the MySQL command line interface. If possible, the following lists the MySQL server error output, which may help you solve the problem. if you still have problems, or the analyzer fails when the command line interface is successfully executed. reduce your SQL query to a statement that causes the problem, and submit a report with the data in the following cut area:

---- Start cutting ----.................. (Various characters) ---- end cut ---- start source ---.................. (Various garbled characters)

Then, there are various baidu, google, sougou... No solution found.

I remember this problem when I set up the DZ site in the past. At that time, it was unintentional to select an encoding item during the import and then import it .. But this time it won't work .. Baidu again to see if there is any similar repair software. = # Not found #. Use Notepad ++ to open the SQL statement. The SQL file can be imported without garbled characters. High versions can be imported. Low versions are not a problem, and the format is correct. Follow the previous ideas for uploading files.

Try to import data in local mysql.

First, change the name and upload it .. No error was reported !!! However, there is still a line of error message (English translation is also lazy ).

Then re-compress the data in the import ..!!! OK. The local mysql can be imported.

Import mysql in the space.

The compressed SQL statement is reported as the above bug. I'm going... Decompress the package and upload the package. only the table with more instructions is imported, and an error message is displayed. It's too difficult to understand.

The local file has been completely imported, exported from the local mysql instance again, and uploaded .. Solution.

Summary:Check whether the database content is complete and garbled (if yes, it is basically not saved = ).

Build phpmyadmin locally and try to import it (I use phpStudy green version). Then there are various mainstream and non-mainstream ideas. (Encoding conversion, version comparison, format comparison ......), (I changed the file name and compressed the local mysql, exported it locally, and imported it to the space. it seems like there are luck components .)

Baidu said that we can use the repair tool that comes with mysql to try to fix it. my database format and content are complete and I am too lazy to install it, so I didn't try it. you do not need to back up phpmyadmin.

Note the following: mysql encoding:

In the installation directory of mysql, such as: E: Program FilesMySQLMySQL Server 5.0my.ini, you can find the mysql Library encoding, in most cases, you can set to uft-8: default-character-set = utf8 or gbk: default-character-set = gbk

If the encoding is incorrect, the data cannot be imported. after the encoding is modified, the database must be restarted to take effect.

1. condition: on the same Server, mysql databases can be properly backed up and restored using the export and import functions of the platform.

2. condition: When the my. ini encoding is consistent on different servers, mysql databases can use the export and import functions of the platform to back up and restore data normally.

2. condition: on different servers. when the ini encoding is inconsistent, you must modify my. only when the ini code is consistent can the mysql database be properly backed up and restored using the export and import functions of the platform.

3. for files imported using phpmyadmin or other tools, you need to re-process them before using the import function of the platform: take phpmyadmin as an example. after export, save the generated SQL statement as one. SQL file, and then use notepad to modify it:

(1) find the line starting with "create database", for example:

Create database 'database name' default character set latin1 COLLATE latin1_swedish_ci;

Add the -- Symbol to cancel the operation permission of this line (the reason is that the import is from the perspective of a common user and the database cannot be created). In this way, the import function of the platform can be used for import.

(2) then, you can check whether the encoding of this library is consistent with that on your server. if the encoding is inconsistent,

<1> You can use phpmymyadmin to back up the file to a. SQL file that is encoded in the same way. (you can select encoding on the homepage of phpmyadmin)

<2> either modify my. ini encoding, and restart Mysql to import (restart Mysql on the server, management tools, and service management). This method has a higher chance of success. we recommend that you do this.

I. database export

Generally, the database is exported for backup or database migration. For export, we generally choose SQL or Excel instead of Word or PDF. Select the table or all tables to export. When selecting the option, you must select unnecessary options. if you select other options, it will cause trouble or errors to the database. So what should we choose?

In the structure option, we generally use Add if not exists, Add auto_increment value, Enclose table and field names with backquotes (translated as Chinese characters accordingly ), that is, check in the box before the option (you won't tell me this), select Complete inserts, Extended inserts, Use hexadecimal for BLOB in the data option, the Export type is Insert. if you want to UPDATE or replace the data, you can select UPDATE or replace. When you tick the Save as file, it is automatically saved as a file (recommended) and then press Go to Save the database as zip, gzip, or bzip.

II. database import

In particular, I have created an empty database (with no tables) with the same name as the exported database before importing the database. Otherwise, an error is often reported. After the database is created, click the corresponding database to enter (of course, in The phpMyAdmin environment). Then, click the Import button. if you choose the compressed export result, it is best to decompress the package into a file. although phpMyAdmin can recognize the compressed file (Imported file compression will be automatically detected from: None, gzip, zip), it still cannot be recognized: <) Otherwise, phpMyAdmin will tell you that you have found bugs (it is good to have bugs). The character set is the same as when you export the data. the default value is utf8. Then, click Go or execute, in this way, the database is moved to another place, and it is also convenient for you to move the site.

Address:

Reprinted at will, but please attach the article address :-)

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.