How to convert a column to BLOB in R before exporting it into MySQL -


i exporting 2gb data frame r mysql. each column having many values. while exporting data r mysql getting following error:

 not run statement: row size large (> 8126). changing columns text or blob or using row_format=dynamic or row_format=compressed may help. in current row format, blob prefix of 768 bytes stored inline. 

command used:

dbwritetable(conn = con, name = 'tablename', value = as.data.frame(cc)) 

i using rmysql package export data mysql database. didn't create table in mysql database. directly creating table r. can change column's class type blob in r? how deal it?

without reproducible example little hard tell, believe can pass field.types variable dbwritetable. see ?mysqlbuildtabledefinition description of field.types - should named list data types. this question may you.

e.g. if column called bigblob

dbwritetable(conn=con, name='tablename', value=as.data.frame(cc),              field.types=list(bigblob='blob',                               # types other columns              )) 

i believe if specify type 1 column, must specify types others too.


Comments