Error importing CSV into phpMyAdmin

Asked

Viewed 7,634 times

7

I need to import a file .csv for phpMyAdmin, but the special characters do not appear, nor the text that follows them. What may be the problem?




  • 1

    Is your file in UTF-8 or ANSI? Try to open in Notepad++ and check the file format and if applicable convert to UTF-8

  • It worked, thank you.

  • I will write this solution as an answer

3 answers

7


Explanation of the problem

Normally text files with special characters need to be saved in , similarly databases that store texts that also have special characters should be saved in the same format.

This way I assume your text file is in format , where the UTF-8 perfectly comprises all the characters contemplated by the ANSI, but the opposite does not happen.

Therefore whenever you try to read special characters and a text file in ANSI format using UTF-8 it gives error exactly where the special characters are and the file stops being read.

For this reason phpMyAdmin does not perform the import completely.

Solution

Convert the file type to UTF-8 (recommend using Notepad++) and then import normally.

0

To correctly import a CSV file, auto increment fields (id type) must be empty. To do so, save your excel spreadsheet in csv format, leaving the field of the respective ID fields empty. Then open the file created in excel by Notepad.exe and save again the file only now with the uft-8 encoding. Then go to phpmyadmin and import the file created in Notepad.exe. Note to mark the box to change the first row (where it contains column titles), also replace the boxes with the comma (,) with (;) and delete the quotes (") from the respective options.

-2

If the problem persists even after the conversion, you can try to enter the order of the columns in the field with their name. Depending on the image:

Mostra o campo nome das colunas que deve ser informado

Browser other questions tagged

You are not signed in. Login or sign up in order to post.