Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003

    Stunnel with mysql

    I have setup mysql over stunnel between a server and a client. All appears to be working fine and I can see the ports appear in netstat.

    However when trying to connect from the client using 'mysql -u root -p' I receive the following error:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    Any ideas how I should get around this error?

  2. #2
    Join Date
    Feb 2004
    hai ijg0,

    I tend to think that this could be some special characters used in either the username or password field. To check if your DB account info is correct, open the following file for editing and fix accordingly:


    During installation, the db username and passwod are stored as _POST variables, which explains why it would work, but when stored

    in a file, strings could have been altered. To avoid the problem, please try to use normal characters for dbname, dbuser and

    Bright Info Solutions

  3. #3
    Join Date
    Dec 2004
    No, this is due to the fact that the MySQL client libraries automatically connect through UNIX sockets if the hostname is localhost. I'm not sure if this same behaviour happens if you connect to one of your box's real IPs - try that first. Failing that, I believe there's a my.cnf variable you can change that will adjust how the client reacts to this.

    IMO it's a stupid default...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts