|
Tunneling MySQL over SSH
|
|
05-23-2006, 11:51 PM
Post: #1
|
|||
|
|||
|
Tunneling MySQL over SSH
Anyone have any insight regarding this Gotcha?
I can access MySQL from my shell account (on yoda). I can access it from home, when I add my external hostname as a valid host in "Goodies > Manage MySQL". Via telnet I can see that my port forward described here works. But adding localhost as a valid host doesn't seem to work. MySQL refuses to allow access. Here is the error (duplicated from the wiki entry): ERROR 1045 (28000): Access denied for user 'db_user_name'@'localhost' (using password: YES) -B... |
|||
|
05-24-2006, 08:42 AM
Post: #2
|
|||
|
|||
|
Tunneling MySQL over SSH
Don't use localhost as your hostname for command line. Use the actual hostname. MySQL databases aren't located on the same box as your website, which prevents the ability to use 'localhost'.
Command should look like: mysql -u <user> -h <hostname> -p And let me add you're not Tunneling MySQL over SSH. All you're doing is using the MySQL command line client to connect to the MySQL server. No Tunneling at all. --- yerba# rm -rf /etc yerba# |
|||
|
05-24-2006, 09:47 AM
Post: #3
|
|||
|
|||
|
Tunneling MySQL over SSH
I'm familiar with the wiki aritcle you mention. I suspect that it has somehting to do with the custom error message Dreamhost set up for this. It 'sees' localhost and returns the error message regardless.
I don't see the point though. Why not just put the appropiate hostname into the config for your app? --Matttail art.googlies.net - personal website |
|||
|
05-28-2006, 06:08 PM
Post: #4
|
|||
|
|||
|
Tunneling MySQL over SSH
Perhaps I should've more clearly stated the context. I want to avoid directly connecting to the MySQL server, since that is a plaintext connection.
I'm tunneling via SSH through my DH server to connect to the DH MySQL server from my laptop. Tunneling means I'll be connecting as localhost to localhost (the forwarded port). And as the error message shows, MySQL sees me as coming from 'localhost'. Using my actual hostname would appear to be moot, in this case, as I am not connecting directly. Thanks, -B... |
|||
|
05-28-2006, 10:01 PM
Post: #5
|
|||
|
|||
|
Tunneling MySQL over SSH
I just got this working yesterday.
First, I connected to my shell account like this: ssh -L8888:mydbhost.mydomain.com:3306 myshelluser@mydomain.com Then I connected to their server like this: mysql -u mydbuser -p -h 127.0.0.1 -P 8888 These parameters also worked using a GUI frontend (CocoaMySQL beta for MacOS X). You have to use 127.0.0.1 instead of 'localhost' or the server will refuse to let you in. I hope this helps! |
|||
|
05-28-2006, 10:49 PM
Post: #6
|
|||
|
|||
|
Tunneling MySQL over SSH
Thanks, Shiva! That did the trick. I've updated the wiki page.
-B... |
|||
|
02-25-2009, 11:21 AM
Post: #7
|
|||
|
|||
|
Tunneling MySQL over SSH
i'm trying to use phpMyAdmin over SSH tunnel. using 'mysql' client apps work, but not (yet) the GUI
![]() i've four machines in my setup, Code: (1) local desktop on home_lanCode: Host my_DH_domain.comat this point, i can, @ "(2) web server" shell, Code: ssh -F /usr/local/etc/ssh/ssh_config my_DH_domain.comCode: mysql > in my 'phpmyadmin/config.inc.php' @ "(2) web server", Code: $i = 1but, when I attempt to connect to the _remote_ server @ DH (Server [2]) with phpmyadmin over the SSH tunnel, in browser i get, Code: Server error!any hints as to what's misconfigured on my end? |
|||
|
02-25-2009, 02:27 PM
Post: #8
|
|||
|
|||
|
Tunneling MySQL over SSH
Hi PGNet,
I'm not sure what the problem could be, as I've never configured phpmyadmin before (and haven't done much else since that posting). It looks like you are more advanced at this stuff than I am, anyway! This is probably a posting glitch, but your configuration includes this line: $cfg['Servers'][$i]['DHension'] = 'mysql'; which probably should have 'extension' instead of 'DHension'. Maybe try 'mysqli' as the value as well, since the MySQL is newer than 4.1. Good luck tracking down the problem. Sorry I can't help any more... |
|||
|
« Next Oldest | Next Newest »
|

Search
Member List
Help




