0

I created a user 'vasya'@'%' with all priveleges on some dbs on a remote server.

When I ssh to the server I can mysql -u vasya -p without any problems.

However when I try to ssh tunnel via Sequel Pro using

host: 127.0.0.1
username: vasya
password: *****
port: 3306

ssh host: <My Server IP>
ssh user: <my server user that I used in terminal>
ssh password: ***********

I get:

Unable to connect to host 127.0.0.1 because access was denied.

Double-check your username and password and ensure that access from your current location is permitted.

MySQL said: Access denied for user 'vasya'@'localhost' (using password: YES)

In my.cnf I have set this, even though I don't think it should be necessary for ssh tunneling:

#skip-networking
bind-address = 0.0.0.0

Oh yes, I can successfully connect with Sequel Pro using another user I've created a while back that is no different then vasya.

What could be my problem with Vasya?

3 Answers 3

1

the problem is sequel pro using ssh tunnel will us probably making a connection to localhost and not 127.0.0.1. Now you might think that % might cover localhost but it doesn't. Try to make the same user with the same grants but instead of user@% you will do user@localhost

1
  • Thanks, Mike. But this is what I've started with, before switching to '%'. Just updated mysql.user, flushed privileges again: same error. Jun 6, 2015 at 22:49
0

Figured it out. Unknowingly, I have been running two instances of mysql on the server – the original installation along with xampp. The Sequel Pro was connecting to the original installation, which, of course, did not have my newly created user.

Question remains, however, why did it choose the old mysql disregarding paths that specify xampp installation... Oh well.

Thanks to all who tried to help.

0

I met this issue on Ubuntu 18. Before on Ubuntu 16 it can connect successfully. Found the solution, shared here just in case someone cares:

In the latest MariaDB+Ubuntu18:

select * from mysql.user;

will show root@local has plugin unix_socket, which caused Sequel Pro SSH tunnel failed to use root for mysql.

Change it by:

UPDATE mysql.user SET plugin = 'mysql_native_password' where host='localhost' and user='root';

Then you can login via tunnel again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .