Skip to content
Advertisement

CSV data to MySQL table

I am trying to insert rows from a csv file into a MySQL table.

I tried this code

JavaScript

Nb: tab is a table with two columns name (varchar 20) and nb_cases (double)

I get this error:

DataError: (1265, “Data truncated for column ‘nb_cases’ at row 1”)

Advertisement

Answer

your number doesn’t fit it must be 983.469 with a point not a comma

use

JavaScript
JavaScript
JavaScript
Column count doesn't match value count at row 1
JavaScript
JavaScript
|       x |
| ------: |
| 983.469 |

db<>fiddle here

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement