1

I am trying to connect with MySQL from R (version R-3.3.3). Unfortunately, I get the error. I tried to change the version to R-3.4.0 but the error is persistent.

 library(DBI)
 library(RMySQL)

 db <- dbConnect(MySQL(), dbname = "example", host = "localhost", 
               port = 3306, user = "root", 
               password = "****")

Error: Error in .local(drv, ...) : Failed to connect to database: Error: Lost connection to MySQL server at 'reading authorization packet', system error: 10060

Please help!

Martin Schmelzer
  • 23,283
  • 6
  • 73
  • 98
Cricketer
  • 399
  • 1
  • 3
  • 20
  • http://stackoverflow.com/questions/21091850/error-2013-hy000-lost-connection-to-mysql-server-at-reading-authorization-pa – Parfait Apr 29 '17 at 21:20
  • Those instructions are for Unix system. I am using Windows. Sorry, I must have clarified that before – Cricketer Apr 29 '17 at 21:51
  • Where is your MySQL server situated? Since you use localhost it seems to be same machine you are running R. Do you successfully connect with other tools like phpmyadmin? Or the command line: MySQL.exe? – Parfait Apr 30 '17 at 14:11
  • I tried opening MySQL.exe (mysql -u root -p -host localhost. I got following error: Unknown mysql server host 'ost' <0> – Cricketer Apr 30 '17 at 15:01
  • Yes, something is faulty about your installation. Since this is not a programming issue, try asking on https://dba.stackexchange.com/. But before asking try making an effort, maybe un-install/re-install (backing up data files). – Parfait Apr 30 '17 at 15:06
  • Thank you. I will remove and reinstall MySQL again. Lets see if it works. – Cricketer Apr 30 '17 at 15:12

0 Answers0