Putty with Mysql

Yes_sir21

Weaksauce
Joined
Dec 31, 2009
Messages
85
I need help connecting putty with mysql, this is my first i config putty so bear with me. I have installed mysql just fine on my machine and the command line that it came with works. But what info do i need to connect mysql with putty ?


I get connection refused each time i try to connected with putty. Except when i use ipv4 192.16.xxxxxx and login with my windows user account im connected with mobaSSH which acts like bash and im not able to use mysql. And My public ip (84.xx) and defualt getway ipadresse get connection refused. Port i use is 22 and connection SSH. Port 22 is closed when i check it with canyouseeme.org. I try to open port 22 on my dlink and firewall but to no avail.

All help appreciated. :)
 
I think it'd help if you backed up a bit and told us what you were trying to accomplish. Yes, I get that you are trying to connect to mysql remotely, from the internet it seems. Why? What specifically are you after?

To my knowledge, putty does not contain the necessary code to connect directly to mysql. You'll need a mysql client for that.
 
I want to create databases and tables, do sql query etc through putty. Just like the mysql command line does. No nothing is remote here as of now, all of this on my machine. i just need to configure the connection properly...
 
The only reference I can find to putty and mysql is setting up an ssh tunnel to the mysql server, then setting up ODBC to run across the tunnel ( or run the mysql client locally if linux ).

Is that what you are trying to do? Because putty, by itself, doesn't support connecting directly to mysql.
 
You cannot connect to MySQL with putty. That's not its job.

Putty is a SSH/telnet client and terminal emulator. It has nothing to do with functioning as an SQL client.

You can use putty as a means to admin mysql servers on remote hosts, but that requires an ssh server on the remote end. You then connect to the remote SSH server, and once connected putty presents a shell session. Then, in that session you run the mysql commandline client.
 
when i use ipv4 192.16.xxxxxx and login with my windows user account im connected with mobaSSH which acts like bash and im not able to use mysql.

Am I understanding this right: from your internal LAN network (192.x) you're able to log in remotely to your windows box successfully but not run mysql? What errors are you getting?

It's very likely that the mysql executable is not in your path, so try going to the mysql bin folder and running the program from there.
 
MobaSSH is already installed, is that sufficient? so what you are saying is that it putty is for remote hosts and cannot be used on local host...
 
I never said putty can not talk to a local host. Putty can connect to any network port, local or remote. If you want to test your ssh server, you can connect to 127.0.0.1.
 
Am I understanding this right: from your internal LAN network (192.x) you're able to log in remotely to your windows box successfully but not run mysql? What errors are you getting?

It's very likely that the mysql executable is not in your path, so try going to the mysql bin folder and running the program from there.
Yeah I cant find way to enter mysql. mysql -u root -p wont work.
Well im doing all of this on one singel machine. This is what my putty looks like now http://i453.photobucket.com/albums/qq253/keshawn_10/damn-1.png



I never said putty can not talk to a local host. Putty can connect to any network port, local or remote. If you want to test your ssh server, you can connect to 127.0.0.1.
Works , but it leads me to this http://i453.photobucket.com/albums/qq253/keshawn_10/damn-1.png. Im loggin with my user name and password for my windows admin account. I assume that is wrong or?
 
Last edited:
what does "won't work" mean?

also, cd.. is not a valid command. You need a space between cd and the ..
 
cd to whereever your mysql binaries are, or put them in your $PATH

Once you ssh in, think of it like a cmd prompt window.
 
You're trying to SSH into a Windows box. This is generally not the most useful thing in the world (SSH is far more useful on a unix host) but, if you insist on going this route, look into installing Cygwin. Windows isn't really meant to be a CLI OS so you can't do many things.
 
You're trying to SSH into a Windows box. This is generally not the most useful thing in the world (SSH is far more useful on a unix host) but, if you insist on going this route, look into installing Cygwin. Windows isn't really meant to be a CLI OS so you can't do many things.
Actually, not true now a days. You can pretty much do anything from the CLI that you can do through the gui.

It's not nearly as user friendly as a *nix CLI though.

Oh, and cygwin's implementation of ssh makes baby jesus cry. It's probably the best out there though, certainly the best free implementation.
 
Back
Top