Connect to a MySQL database
library(RMySQL)
mySQL = dbConnect(
MySQL(),
user = 'rene',
password = 'mySecretGarden',
dbname = 'theDB',
host = 'localhost');
Fixing connection problems
Error in .local(drv, ...) : Failed to connect to database: Error: Can't initialize character set unknown (path: compiled_in):
[client]
default-character-set = utf8
[mysql]
default-character-set = utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
skip-character-set-client-handshake
Error in .local(drv, ...) : Failed to connect to database: Error: Plugin caching_sha2_password could not be loaded: The specified module could not be found. needed the following to fix
alter user rene@'%'
identified with mysql_native_password by 'rene';