Couldn't join the Tuesday work session but hope to get some guidance here from this forum.
I have a remote Xsede Linux VM that I access via putty and run R sessions on, its my tmux-vim-R( or Python) workstation but only allows 10 GB of storage, if I can connect to database server on my laptop it'd be perfect.
On my laptop I have a MySQL server installed that I have successfully connected to from R studio, and R Studio on another laptop over my home network(with Wireless LAN adapter Wi-Fi: IPv4/IPv6 address). I have also successfully been able to connect to it from R on Linux subsystem on Windows 10( Ethernet adapter VirtualBox Host-Only Network: IPv4/IPv6 address).
I am unable to connect the remote session (running via Putty) with the MySQL server on my laptop after trying similar approaches to above; using every different IP address given in windows (under 'ipconfig /all' command from windows command prompt).
I don't know where to focus my troubleshooting effort. I would have benefited from making it out a work session but was not possible. I'd like to start with one clarification: If I am in an R session on Linux VM via Putty, shouldn't I be able to use one of the IP addresses under 'ipconfig' output in windows command prompt to link with MySQL server on my laptop just as I can from another computer over my home network using 'Wireless LAN adapter Wi-Fi: IPv4/IPv6 address' or from Windows Linux subsystem using 'Ethernet adapter VirtualBox Host-Only Network: IPv4/IPv6 address'. I mention both IPv4 and IPv6 because there is configuration in MySQL that allows the use of one or another.
Am I missing something regarding what the 'host' parameter should equal?
I have a mysql server install on the Xsede VM aw well and I am able to access databases in it from R session as show below( accessing the 'world' db):
con = dbConnect(dbDriver("MySQL"), user = "blsingh", password = "root", dbname = "world", host = "127.0.0.1")
I tried to set up a
tunnel with Putty session as such: in putty, under the tunnel tab, enter '3307' for source port, and 'localhost:3306' as the destination ( also tried
127.0.0.1:3306 or
0.0.0.0:3306 as the destination), then with RMySQL library from R in remote session (in Putty) tried the dbConnect( ) to establish a connection over the tunnel. (Note: I have another tunnel that I successfully use to display graphics in web browser on windows session with 'rmote' package. Below is an attempt in Putty remote session where I was hoping to use the tunnel to connect to mysql running on port 3306 in windows, connecting to it with tunnel connection as explained above).
con = dbConnect(dbDriver("MySQL"), user = "root", password = "xxxxx", dbname ="lahman2016", host = "localhost", port =3307)
The idea is that MySQL server is listening on port 3306 on windows OS and I use port 3307 in VM to connect to MySQL installed on windows( just as I use port 4324 as source and localhost:4324 with 'rmote' package to display graphics in windows web browser using '
127.0.0.1:4324' url in web browser instead of using X11/Xming).
In putty event log is can see the following logs:
2017-09-12 16:06:35 Local port 3307 forwarding to localhost:3306
2017-09-12 16:06:35 Local port 4324 forwarding to localhost:4324
While I can access the output of plot and help(?) command in windows browser after 'rmote::start_rmote(port=4324)' command in R, I cannot connect to MySQL server on windows.
These are the errors:
> con2 = dbConnect(dbDriver("MySQL"), user = "root", password = "lqsymM7&", dbname = "lahman2016", host = "127.0.0.1", port = 3307)
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to MySQL server on '127.0.0.1' (107)
, then if I chage host to 'localhost':
> con2 = dbConnect(dbDriver("MySQL"), user = "root", password = "lqsymM7&", dbname = "lahman2016", host = "localhost", port = 3307)
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13)
, thereupon I found the in from Bash prompt
blsingh@js-169-21:~$ mysql_config --socket
/var/run/mysqld/mysqld.sock
, so next I tried
> con2 = dbConnect(dbDriver("MySQL"), user = "root", password = "lqsymM7&", dbname = "lahman2016", host = "localhost", port = 3307, unix.socket = "/var/run/mysqld/mysqld.sock")
Error in .local(drv, ...) :
Failed to connect to database: Error: Access denied for user 'root'@'localhost' (using password: YES)
, so next I find the my.ini in windows for MySQL server at 'c:/ProgramData/MySQL/MySQL Server 5.7/my.ini' and add the following line and restart mysql service from Services window and at mysql> flush privileges;
skip-grant-tables
All to no avail. All the while I can access mysql server from windows linux subsystem with 'Link-Local IPv6 Address'
Any help in resolving my issue will be greatly appreciated. Thanks
And should I be learning some networking skills and if so where should I start if I wish to troubleshoot such issues.
Thanks in advance,
Sher