List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 20 2000 9:37pm
Subject:Re: Error 2002 (Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2))
View as plain text  
At 4:08 PM -0500 03-20-2000, Monika Plawna wrote:
>Thanks for all the replies!
>
>Using mysqladmin -variables |grep sock
>I got /tmp/mysql.sock
>
>????

So the socket should be at /tmp/mysql.sock after all.
If you shutdown and restart the server, does the socket file reappear?

In any case, the connection you're making must be using a TCP/IP
connection, or mysqladmin wouldn't work at all.


>Now I have even more problems...
>I was at a complete loss and decided to start from scratch with the 
>databases. I
>tried to re-install the tables using the scripts that Paul provided 
>with the book.
>Whenever I try to run them, using
>mysql -u monika -p < reload_table.sh
>when I get the prompt for password, the stars show up by themselves 
>(ie. I'm not
>typing in the password), and the login fails.

It sounds like the HP-UX password reading function acts like the one 
on Solaris,
in that it reads from the standard input rather than from the terminal.  You
should be able to get around this by creating a .my.cnf file in your home
directory with the password in it:

[client]
password=your-password

Make sure to change the file to mode 600 after creating it.

>It worked properly before! Same thing happens when I try to run all the other
>scripts.
>
>I'm tempted to re-install everything...
>How do I un-install, or should I just overwrite all the files?

That may not be necessary.


>
>Thanks again!
>
>Monika
>
>sasha@stripped wrote:
>
>>  Monika Plawna wrote:
>>  >
>>  > Hi all,
>>  >
>>  > Yes, I'm a newbie, and yes, I know you will want to refer me to the
>>  > manual, but please hear me out. I've already tried that.
>>  >
>>  > I installed mysql 3.22.32 on HP-UX 10.2 as well as the DBI-1.13,
>>  > Data-Dumper-2.09, Msql-Mysql-modules-1.2018
>>  > I also got Paul DuBois' book.
>>  >
>>  > I setup a user on the samp_db by the name of monika, I gave her a
>>  > password and I tried running a script from Paul's book (I changed the
>>  > user name and password), dump_members.
>>  > I got the following error:
>>  >
>>  > Error 2002 (Can't connect to local MySQL server through socket
>>  > '/tmp/mysql.sock' (2))
>>  >
>>  > So I did the sensible thing and searched the list, but I found everyone
>>  > who asked about this was referred to the manual. So I've tried that.
>>  > I went through the section, trying every single suggestion - but they
>>  > all work! Here's the what I was able to execute:
>>  >
>>  > ps -ef | grep mysql
>>  > mysqladmin version
>>  > mysqladmin variables
>>  > mysqladmin -h `hostname` version variables
>>  > mysqladmin -h `hostname` --port=3306 version
>>  > mysqladmin -h <ip of my machine>' version
>>  > mysqladmin --socket=/tmp/mysql.sock version
>>  >
>>  > I also tried    telnet <my host> 3306 and it worked too!   I got the
>>  > version number, and then the following message
>>  > Bad handshakeConnection closed by foreign host.
>>  >
>>  > The only thing I'm not sure about is, I checked /tmp and I didn't find
>>  > mysql.sock.  I don't know if it has to show up, but it didn't. However,
>>  > as I mentioned above, all the commands work, and if I tried to connect
>>  > using mysql -u monika -p samp_db it works like a charm.
>>  > Please help!
>>  >
>>  > Monika
>>  >
>>  > --
>>
>>  Looks like your socket file is somewhere else and your Perl client 
>>does not know
>>  it. The easiest way to fix the problem would be:
>>
>>  mysqladmin variables | grep sock
>>
>>  find out where your socket file is and then symlink 
>>/tmp/mysql.sock to point to
>>  the real location of the socket.
>>
>>  There might be a more civilized what to convince Perl DBI to look 
>>in the right
>>  location for the socket, but I don't know how to do it off the top 
>>of my head
>>  without reading the docs ...
>>
>>  --
>>  Sasha Pachev
>>
>>  +------------------------------------------------------------------+
>>  | TcX  ____  __     _____   _____  ___     ==  mysql@stripped        |
>>  |     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sasha Pachev            |
>>  |    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sasha@stripped  |
>>  |   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Provo, Utah, USA        |
>>  |  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                         |
>>  |  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                        |
>>  |             /*/             \*\ Developers Team                  |
>>  +------------------------------------------------------------------+

-- 
Paul DuBois, paul@stripped
Thread
Error 2002 (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2))Monika Plawna20 Mar
  • Re: Error 2002 (Can't connect to local MySQL server throughsocket '/tmp/mysql.sock' (2))Paul DuBois20 Mar
  • Re: Error 2002 (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2))sasha20 Mar
  • Re: Error 2002 (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2))Monika Plawna21 Mar
    • Re: Error 2002 (Can't connect to local MySQL server throughsocket '/tmp/mysql.sock' (2))Paul DuBois21 Mar
  • Re: Error 2002 (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2))sasha21 Mar
  • Re: Error 2002 (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2))Monika Plawna21 Mar
    • Re: Error 2002 (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2))sinisa21 Mar
    • Re: Error 2002 (Can't connect to local MySQL server throughsocket '/tmp/mysql.sock' (2))Paul DuBois21 Mar
  • Re: Error 2002 (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2))Monika Plawna22 Mar