5

I am a novice in R. I am trying to connect to mySQL in R through RMyQL package. I am using the following command to connect to a sql server

ucscdb<-dbConnect(MySQL(),user="xxxx",password="xxxx",dbname="More",host="http://54.89.81.190/phpmyadmin/").

I am getting following error

**Error in .local(drv, ...) : 
  Failed to connect to database: Error: Unknown MySQL Server Host 'http://54.89.81.190/phpmyadmin/' (11001)**

What can be the possible reasons.The same SQl server is easily connecting in linux/

NicE
  • 21,165
  • 3
  • 51
  • 68
Krish Mahajan
  • 263
  • 3
  • 9
  • Have you tried the steps here: https://stackoverflow.com/questions/10292326/how-to-connect-r-with-mysql-or-how-to-install-rmysql-package – felixmc Mar 09 '15 at 12:32
  • @felixmc the answers there are outdated - you can now get RMySQL directly from CRAN – hadley Mar 12 '15 at 11:12
  • The host should be something like `"http://54.89.81.190"`, not the path to you phpmyadmin install. – hadley Mar 12 '15 at 11:13

1 Answers1

0

Perhaps you should pass some values to another arguments of dbConnect: unix.socket and port, as described in dbConnect's documentation. These values can be accessed through phpinfo.php in your browser, as phpMyAdmin has modified MySQL file system and saved somewhere in its installation directory. For example, in Ubuntu default phpMyAdmin installation directory, the value of unix.socket could be: '/opt/lampp/var/mysql/mysql.sock' and 3306 for that of the port.

h45
  • 206
  • 1
  • 6