0

I have a 80 * 5 data.frame df using

dbWriteTable(mydb, name = "fooDB", df, field.types = dbtypes, row.names = FALSE, append = TRUE)

to import to MySQL database. However, it only imports the first row of df.

Does anyone have similar problem? Or anyone has some suggestions.

Bin Hao
  • 61
  • 7

1 Answers1

0

I have solved the problem and just share with all you guys.

The former table defined in MySQL server has a primary key of type int() but the column of data.frame in R is beyond 4 bytes.

Just change the type of primary key to bigint() which is 8 bytes format.

Bin Hao
  • 61
  • 7