'mysql phpmyadmin import csv disable rounding
I have a CSV file which contains longitude and latitude values and when I import a CSV file into a table all the string values are imported without any mistakes but the lat and long values are rounded like 15.7456 to 16. So is there a way to avoid that as the CSV file will contain like thousands of data so manual correction won't be an option here. Thank you in advance.
Solution 1:[1]
seems like your lat- and long-fields are int's. Try to alter the table structure for this field to e.g. decimal(8,2). More information on decimal data type here.
Solution 2:[2]
I am late to this question, but my response may still help someone. In similar situations when importing CSV data, I have created a blank table with just the structure and made the fields all of type VARCHAR 250. This has proven to be a very forgiving format for importation. Once you have checked the data is safely in MySQL you can then start the process of changing the structure to the right format and adding a primary key.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sladda |
| Solution 2 | Lew Perren |
