pkowalchuk
pkowalchuk

Reputation: 31

rmysql - Error: Can't initialize character set unknown

Trying to connect to MySQL from r:

library(RMySQL)
mydb<-dbConnect(MySQL(), user='root', password='123', dbname='mydb', host='localhost')

Getting the following error:

Error in .local(drv, ...) : Failed to connect to database: 
Error: Can't initialize character set unknown (path: compiled_in)

Using

R ver is 3.3.3
MySQL is '8.0.12'
default_character_set_name in MySQL is utf8mb4

Upvotes: 2

Views: 3877

Answers (1)

Irungbon
Irungbon

Reputation: 31

I had the same issue when I installed MySQL 8.0.19 Solution is locate and open your my.cnf and set character-set for mysql server.

character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

Upvotes: 3

Related Questions