Trying to use R with MySQL: The used command is not allowed with this MySQL version

前端 未结 1 424
星月不相逢
星月不相逢 2021-01-06 09:34

I am trying import a data set into a table in MySQL. I am using MySQL 8.0.11 and version 1.1.453 of R Studio. I am using the RMySQL package.

The line in question i

1条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-06 09:49

    The following steps should fix the dbWritetable() error in R:

    1. Login MySQL terminal by typing "MySQL -u user -p*" (followed by user password if you set one).

    2. Type "SET GLOBAL local_infile = true;" in the MySQL terminal command.

    3. Lastly, type "SHOW GLOBAL VARIABLES LIKE 'local_infile';" into the terminal and check the command line output for the ON status.

    I'm not sure why the database function fails from MySQL 5.6 to 8.0, however, "local_infile" enables user access to data loads from local sources--- this solution should work for all database interference stacks (R, Python, etc)!

    0 讨论(0)
提交回复
热议问题