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/ –