Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Oct 27, 2013 11:51 pm 
Offline
Newbie

Joined: Sun Oct 27, 2013 11:38 pm
Posts: 2
We are running Ubuntu 12.10, fully patched.
I am trying to remotely tunnel to mysql, using the instructions on this page (from my Ubuntu 12.04 vm, fully patched,
with mysql installed):

https://library.linode.com/databases/my ... ssh-tunnel

This is my connection string to set up the tunnel (I am using passwordless login, linode is in my ssh config file)

ssh -L 127.0.0.1:3307:127.0.0.1:3306 linode -N

Once this is done, I attempt to connect to mysql (from another shell):

mysql -u root -h 127.0.0.1 -p -P 3307

I get a password prompt.
When I enter the password, I get the following error in the shell where I issued the mysql command:

ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

In the shell where the ssh tunnel command is running, I get the following error simultaneously:

channel 1: open failed: connect failed: Connection refused.

Mysql still has the bind address set to 127.0.0.1
I have no problem connecting to Mysql from a normal ssh login with the same credentials.

I retried the ssh forward with the following command:

ssh -vvv -L 127.0.0.1:3307:127.0.0.1:3306 linode -N

Here is the portion of the debug output after the authentication section.

Authenticated to li563-200.members.linode.com ([198.74.62.200]:22).
debug1: Local connections to 127.0.0.1:3307 forwarded to remote address 127.0.0.1:3306
debug3: channel_setup_fwd_listener: type 2 wildcard 0 addr 127.0.0.1
debug1: Local forwarding listening on 127.0.0.1 port 3307.
debug2: fd 4 setting O_NONBLOCK
debug3: fd 4 is O_NONBLOCK
debug1: channel 0: new [port listener]
debug1: Entering interactive session.

So I am stuck. Have also tried a number of other recommendations from stackoverflow, etc., but always get the same Mysql error.
Any suggestions welcome.

Ian

Update, as a test I installed Mysql Workbench (client only) on Windows 7-64 and created a connection to the
server using ssh over tcp/ip, with key-based authentication. Error is similar to above:

Failed to Connect to MySQL at 127.0.0.1:3306 through SSH tunnel
at li563-200.members.linode.com with user root.

Lost connection to MySQL server at 'reading initial communication packet',
system error: 0

--
Second update.
Following suggestion from support, enabled skip-networking in my.cnf
This got rid of the "lost connnection" error,
however still getting

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

which seems like progress. As far as I can tell I have granted the needed privileges for root@localhost, and root@127.0.0.1
but will continue to check.


Top
   
PostPosted: Mon Oct 28, 2013 10:02 pm 
Offline
Newbie

Joined: Sun Oct 27, 2013 11:38 pm
Posts: 2
Problem fixed! Got some good help from support, but ultimately figured
out that I had an entry for 'root'@'%' with no password as the result of earlier
experimentation. I dropped that entry, and was then able to log in over the tunnel
with root@127.0.0.1


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group