Re: MySQL via SSH Tunnel



Andreas Stallmann wrote:
Hallo zusammen,

ich versuche - einigermaßen verzweifelt - MySQL über eine SSH-Verbindung zu betreiben.
....
Versuche ich aber einen Verbindungsaufbau via mysql, scheitert dies:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LC ~ # mysql -u root -P 3307 localhost
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Der Socket existiert. Wenn ihn lösche, ist die Fehlermeldung allerdings die selbe.

Wenn ich nicht ganz falsch liege connected sich MySQL immer über den mysqld.sock wenn du als Host localhost angibst. Gib ihm ne IP, dann sollte er sich über TCP/IP verbinden.

Steht aber auch alles im Handbuch:

A.2.2. Can't connect to [local] MySQL server
http://dev.mysql.com/doc/refman/4.1/en/can-not-connect-to-server.html

A MySQL client on Unix can connect to the mysqld server in two different ways: By using a Unix socket file to connect through a file in the filesystem (default /tmp/mysql.sock), or by using TCP/IP, which connects through a port number. A Unix socket file connection is faster than TCP/IP, but can be used only when connecting to a server on the same computer. A Unix socket file is used if you don't specify a hostname or if you specify the special hostname localhost.

gruß, Frank
.



Relevant Pages

  • Re: Connect method fails
    ... I am trying to make a simple client/server aplication under unix. ... Connection to the server via telnet ... struct hostent *host; ... The socket you create is an unix domain socket. ...
    (comp.unix.programmer)
  • Re: Connect to DB on Unix machine; and File Transfer
    ... I didn't understand that your desktop machine is running Unix. ... That should work with any database and any OS that supports Web ... >>> using for the application is MySql. ... >>> the server, insert it into SQLServer CE, and later upload it back to ...
    (microsoft.public.dotnet.framework.compactframework)
  • socket.
    ... I have installed DBI-1.19, and trying to use radiator radius server to call an MySQL query using DBI. ... My actual socket is under /etc. ...
    (perl.dbi.users)
  • Re: Connect method fails
    ... I am trying to make a simple client/server aplication under unix. ... Connection to the server via telnet ... struct hostent *host; ... The socket you create is an unix domain socket. ...
    (comp.unix.programmer)
  • Re: Connect method fails
    ... I am trying to make a simple client/server aplication under unix. ... Connection to the server via telnet ... struct hostent *host; ... The socket you create is an unix domain socket. ...
    (comp.unix.programmer)