

To allow you access using the SSH port forwarding you need something like: GRANT SELECT ON *.* TO then run FLUSH PRIVILEGES This means that both the server must grant privileges to users from specifically 127.0.0.1, and the client must use -h 127.0.0.1 to go through the tunnel instead of connecting to a local socket. In MySQL, the localhost keyword is reserved for connection using the MySQL socket and you should use the ip-address 127.0.0.1 for TCP connections to the MySQL network port on 127.0.0.1. Would still love to know why SSH tunnels are being denied though. Here's the list of hosts that root is currently granted access on: mysql> select host,user from er where user='root' Īs I understand it, the first row ("%") should really make the the others redundant?įixed the grant issue the user has not been granted all privileges with the extra with grant option on the end, so it could do everything but grant. Again though, from the terminal I can do anything when logged in as root.Ĭan anybody help shed some light on why tunnel connections and (probably) grant commands are receiving the access denied error?įor reference MySQ is version 5.6.16 with mostly the default settings, installed via Homebrew on a MAC OS X Server machine.

Oddly the user is actually created, I think it's just an issue with grant. The only problem is when I come to create users I get the error:Īccess denied for user (using password: YES) This works for the most part, I can view table data, create new databases, etc. In an attempt to get around the tunnelling issue, I granted access to so that I can connect directly. A friend suggested that's probably just bad error handling, but it seems strange given the significant difference between localhost and 127.0.0.1 in MySQL. When I started looking into it more I noticed that the error was reporting the server as "localhost", instead of "127.0.0.1" which I entered in Sequel Pro. I've reset the password with mysqladmin just for sanity's sake, that's definitely not the issue. The problem isn't specific to Sequel Pro or just myself either, I get the same error when connecting through MySQL Workbench as do others in the office. I'm able to log in from the terminal when connected directly to the server through SSH, just not through an SSH tunnel.

MySQL said: Access denied for user (using password: YES) Unable to connect to host 127.0.0.1 because access was denied.ĭouble-check your username and password and ensure that access from your current location is permitted. All of sudden though, with no changes I can think of, the server has started rejecting the log in attempt from Sequel Pro with the error: For months I've been connecting to the MySQL instance running on our local test server through an SSH tunnel without any issues.
