1
我正在学习如何在R中的包RMySQL使用MySQL:无法连接到本地MySQL服务器中的R
https://www.tutorialspoint.com/r/r_database.htm
但是当我尝试连接到在例如
提供的DBmysqlconnection = dbConnect(MySQL(), user = 'root', password = '', dbname = 'sakila', host = 'localhost')
我得到:
Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
我的猜测是,我运行它只是在我的LAPT op(mac os),所以如果我的猜测是正确的(?),我需要一些虚拟服务器。
你知道有这样做的R包吗?任何建议表示赞赏。
谢谢,应该在R promp中运行“service”和“mysql”命令吗? –
Nop。你的操作台。 –
https://coolestguidesontheplanet.com/start-stop-mysql-from-the-command-line-terminal-osx-linux/ –