Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon May 11, 2015 4:48 pm 
Offline

Joined: Mon May 11, 2015 4:21 pm
Posts: 1
Hi everyone,

I'm trying to connect to the database on my linode - I've set up SSH to use authentication keys, and I'm trying to set up an SSH tunnel within MySQL Workbench. The trouble is that I just can't connect to the MySQL service.

I'm using Ubuntu 14.04 LTS. In workbench I've entered the IP address of my linode, my SSH username, I've pointed it to my private key file, the MySQL hostname is set to 127.0.0.1 and the port is 3306. The username is root, and the password is the root password.

No matter what I do I just can't connect. When I click 'test connection', I get a message box saying "Successfully made the MySQL connection". But when I actually try and open the connection, I get a message saying: "Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:". If I just SSH to the server though, and run MySQL, there's no problem logging in.

Is there something I'm missing or could it be a bug in Workbench? This is the output from the workbench log:

Code:
21:35:46 [INF][     SSH tunnel]: Existing SSH tunnel found, connecting
21:35:47 [INF][      SqlEditor]: Opened connection 'Linode Schemas' to (Ubuntu) version 5.5.43-0ubuntu0.14.04.1
21:35:47 [INF][     AutoCCache]: Initializing autocompletion cache for Linode_Schemas
21:35:49 [ERR][      SqlEditor]: SQL editor could not be connected: Lost connection to MySQL server during query
21:35:49 [ERR][      SqlEditor]: Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
  Lost connection to MySQL server during query

Please:
1 Check that mysql is running on server 127.0.0.1
2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
21:35:49 [INF][     SSH tunnel]: Existing SSH tunnel found, connecting


Also this is the output of
Code:
netstat -tln


Code:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State     
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN   


Thanks a lot for you help.


Top
   
PostPosted: Tue May 12, 2015 4:58 pm 
Offline
Linode Staff

Joined: Mon Aug 18, 2014 2:43 pm
Posts: 35
Website: https://levlaz.org
Location: Absecon, NJ
Can you try to change the MySQL hostname from 127.0.0.1 to localhost?

_________________
Best,
Lev
https://levlaz.org


Top
   
PostPosted: Tue May 12, 2015 5:00 pm 
Offline
Linode Staff

Joined: Mon Aug 18, 2014 2:43 pm
Posts: 35
Website: https://levlaz.org
Location: Absecon, NJ
Actually, more specifically can you check the value of bind-address in /etc/mysql/my.cnf on the server? It should be on line 47.

_________________
Best,
Lev
https://levlaz.org


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


Who is online

Users browsing this forum: No registered users and 3 guests


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