Trying to establish connection between RStudio and MariaDB

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Trying to establish connection between RStudio and MariaDB

Postby napobenitez » 24. January 2023 18:42

I´ve installed xampp 8.2.0-0 on a mac book pro 14 inches, chip Apple M1 pro, OS Monterey. I've tried to connect RStudio version 2022.07.1 to Mariadb database that is part of xamp 8.2.0-0.
In Rstudio console I previously installed package RMariaDB. I've follow the script
drv <- dbDriver("MySQL")
con <- dbConnect(drv, username="root",
password="",
dbname ="db_name",
host="localhost")
However, I got the following error message
"Error: Failed to connect: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"

How can it be solved ?
napobenitez
 
Posts: 2
Joined: 24. January 2023 18:28
XAMPP version: 8.2.0-0
Operating System: macOS Monterey

Re: Trying to establish connection between RStudio and Maria

Postby Nobbie » 25. January 2023 21:03

You probably installed the VM Version of Xampp for OSX. If you did so, you cannot connect to MariaDB, as it does not run in the scope of your OSX, but instead in a Virtual Machine. If you want to establish a connection to Xampps MySQL, you should install Xampp as native OSX installation, not as VM (Virtual Machine).
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Trying to establish connection between RStudio and Maria

Postby napobenitez » 25. January 2023 21:44

Thanks to your reply. I installed Xampp as an application. Not as virtual machine.
napobenitez
 
Posts: 2
Joined: 24. January 2023 18:28
XAMPP version: 8.2.0-0
Operating System: macOS Monterey

Re: Trying to establish connection between RStudio and Maria

Postby Nobbie » 25. January 2023 22:25

Ok, i dont know the dbDriver interface, but obviously you did not specify a TCPIP Port. Maybe the API tries to connect via Socket per default, which is not implemented. Try to apply the appropriate Port (3306) instead.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 18 guests