1

I am currently trying to get some latitude and longitude data to import into a database using the data import wizard in mysql workbench. the problem is that the floating point values that get imported are modified by mysql workbench, or whatever query it's preforming, so they are useless. Example:

40.8152 turns into 40.0000.

I cannot figure out why this is happening. I have the columns set to DECIMAL(6,4), but they still get modified when imported.

Anybody have any ideas as to what might be causing this and how i can get these to import correctly?

Edit:

I have also tried FLOAT, FLOAT(6,4), DOUBLE and DOUBLE(6,4) with the same results. It either removes the trailing decimal values completely or sets them to 0.

0

Well, I couldn't figure out how to do it in Mysql Workbench, but I have a workaround.

Use:

mysqldump -u mysqlUser -p DatabaseName TableName > table_data

To get data out of the table you want to use, then use:

mysql -u mysqlUser -p DatabaseName TableName < table_data

To get the data into the desired table. This will retain the correct values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.