FW: Problems with mysql.sock

FW: Problems with mysql.sock

am 15.09.2003 14:50:44 von michael.watson

Hi

I need to know how and where to tell mysql to look for mysql.sock.

I am using mysql version 3.23.55 and SUSE Linux 8.2.

My problem is that i have a mysql daemon working very well and using /var/lib/mysql/mysql.sock as the correct socket. No problems.

My problems come when I try and install the perl msql-mysql modules.

It asks for my mysql directory, which is /usr/local/mysql/.

I can only assume that it then tries to execute /usr/local/mysql/bin/mysql, and guess what? For some reason it tries to connect through the default /tmp/mysql.sock, which doesn't exist and everything fails.

SO whats going on? Why, when i execute /usr/bin/mysql does mysql look to /var/lib/mysql/mysql.sock and when I execute /usr/local/mysql/bin/mysql, does it look to /tmp/mysql.sock? How can I set BOTH to look at /var/lib/mysql/mysql.sock?

I tried mysql_config --socket /var/lib/mysql/mysql.sock, but all that does is repeat the usage message for mysql_config.

So when I try to connect through DBI, I get a "cannot connect through /tmp/mysql.sock" error message. But the mysql on my computer, the daemon that is up and running, always connects through /var/lib/mysql/mysql.sock. I even have that set in /etc/my.cnf.

Help me, I am confused!

Thanks
Mick

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: FW: Problems with mysql.sock

am 15.09.2003 15:02:53 von Jochen Wiedmann

michael watson (IAH-C) wrote:

> I need to know how and where to tell mysql to look for mysql.sock.

perldoc DBD::mysql

You cannot change the location at compile time, because it is compiled into
the C driver. However, you may change it at run time.


Jochen



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: FW: Problems with mysql.sock

am 15.09.2003 15:02:53 von Jochen Wiedmann

michael watson (IAH-C) wrote:

> I need to know how and where to tell mysql to look for mysql.sock.

perldoc DBD::mysql

You cannot change the location at compile time, because it is compiled into
the C driver. However, you may change it at run time.


Jochen



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 15:05:41 von michael.watson

My real problem is with DBI::mysql

It seems to think that mysql.sock is at /tmp/mysql.sock.

It isn't. It's at /var/lib/mysql/mysql.sock. /usr/bin/mysql knows this, /usr/bin/mysql_config knows this, and /etc/my.cnf knows this, but /usr/local/mysql/bin/mysql still looks for /tmp/mysql.sock, as does DBI::mysql.

It's almost as if I have two versions of mysql on my machine, but I don't. Why on earth DBI::mysql takes one above the other is anyone's guess.

-----Original Message-----
From: Jochen Wiedmann [mailto:joe@ispsoft.de]
Sent: 15 September 2003 14:03
To: michael watson (IAH-C)
Cc: 'perl@lists.mysql.com'
Subject: Re: FW: Problems with mysql.sock


michael watson (IAH-C) wrote:

> I need to know how and where to tell mysql to look for mysql.sock.

perldoc DBD::mysql

You cannot change the location at compile time, because it is compiled into
the C driver. However, you may change it at run time.


Jochen


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 15:05:41 von michael.watson

My real problem is with DBI::mysql

It seems to think that mysql.sock is at /tmp/mysql.sock.

It isn't. It's at /var/lib/mysql/mysql.sock. /usr/bin/mysql knows this, /usr/bin/mysql_config knows this, and /etc/my.cnf knows this, but /usr/local/mysql/bin/mysql still looks for /tmp/mysql.sock, as does DBI::mysql.

It's almost as if I have two versions of mysql on my machine, but I don't. Why on earth DBI::mysql takes one above the other is anyone's guess.

-----Original Message-----
From: Jochen Wiedmann [mailto:joe@ispsoft.de]
Sent: 15 September 2003 14:03
To: michael watson (IAH-C)
Cc: 'perl@lists.mysql.com'
Subject: Re: FW: Problems with mysql.sock


michael watson (IAH-C) wrote:

> I need to know how and where to tell mysql to look for mysql.sock.

perldoc DBD::mysql

You cannot change the location at compile time, because it is compiled into
the C driver. However, you may change it at run time.


Jochen


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: FW: Problems with mysql.sock

am 15.09.2003 15:18:14 von Jochen Wiedmann

michael watson (IAH-C) wrote:

> My real problem is with DBI::mysql

This is exactly what I was talking about. :-)


> It's almost as if I have two versions of mysql on my machine, but I don't.

You have. :-) The location of the MySQL socket is compiled into the server,
into the client library (for example libmysqlclient.a) and into the client
binaries (for example "mysqladmin" or "mysql"). Each of them *may* have a
different location, which seems to be the case on your system.


Jochen



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: FW: Problems with mysql.sock

am 15.09.2003 15:18:14 von Jochen Wiedmann

michael watson (IAH-C) wrote:

> My real problem is with DBI::mysql

This is exactly what I was talking about. :-)


> It's almost as if I have two versions of mysql on my machine, but I don't.

You have. :-) The location of the MySQL socket is compiled into the server,
into the client library (for example libmysqlclient.a) and into the client
binaries (for example "mysqladmin" or "mysql"). Each of them *may* have a
different location, which seems to be the case on your system.


Jochen



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 15:20:18 von michael.watson

Ah, I see.
I know I *can* specify the socket at runtime in DBD::mysql, but I am using a whole load of someone else code, which doesn't specify the mysql socket.... so unless I can get DBD::mysql to work with the socket default, i will have to do 1000s of find -> replaces to add the extra parameter to the calls to DBI->connect(). And then each time the software is updated, do it again.

So what you seem to be saying is that I need to re-install mysql or do the above?

-----Original Message-----
From: Jochen Wiedmann [mailto:joe@ispsoft.de]
Sent: 15 September 2003 14:18
To: michael watson (IAH-C)
Cc: 'perl@lists.mysql.com'
Subject: Re: FW: Problems with mysql.sock


michael watson (IAH-C) wrote:

> My real problem is with DBI::mysql

This is exactly what I was talking about. :-)


> It's almost as if I have two versions of mysql on my machine, but I don't.

You have. :-) The location of the MySQL socket is compiled into the server,
into the client library (for example libmysqlclient.a) and into the client
binaries (for example "mysqladmin" or "mysql"). Each of them *may* have a
different location, which seems to be the case on your system.


Jochen


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 15:20:18 von michael.watson

Ah, I see.
I know I *can* specify the socket at runtime in DBD::mysql, but I am using a whole load of someone else code, which doesn't specify the mysql socket.... so unless I can get DBD::mysql to work with the socket default, i will have to do 1000s of find -> replaces to add the extra parameter to the calls to DBI->connect(). And then each time the software is updated, do it again.

So what you seem to be saying is that I need to re-install mysql or do the above?

-----Original Message-----
From: Jochen Wiedmann [mailto:joe@ispsoft.de]
Sent: 15 September 2003 14:18
To: michael watson (IAH-C)
Cc: 'perl@lists.mysql.com'
Subject: Re: FW: Problems with mysql.sock


michael watson (IAH-C) wrote:

> My real problem is with DBI::mysql

This is exactly what I was talking about. :-)


> It's almost as if I have two versions of mysql on my machine, but I don't.

You have. :-) The location of the MySQL socket is compiled into the server,
into the client library (for example libmysqlclient.a) and into the client
binaries (for example "mysqladmin" or "mysql"). Each of them *may* have a
different location, which seems to be the case on your system.


Jochen


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 15:33:46 von Ulrich Borchers

quick and dirty:

cd /tmp
ln -s /var/lib/mysql/mysql.sock mysql.sock
(don't remember location of your .sock file)
But this is probably not supposed to be a good solution :-)

Uli

On 15 Sep 2003 at 14:20, michael watson (IAH-C) wrote:

> Ah, I see.
> I know I *can* specify the socket at runtime in DBD::mysql, but I am usi=
ng a whole load of someone else code, which doesn't specify the mysql sock=
et.... so unless I can get DBD::mysql to work with the socket default, i w=
ill have to do 1000s of find -> replaces to add the extra parameter to the=
calls to DBI->connect(). And then each time the software is updated, do =
it again.
>
> So what you seem to be saying is that I need to re-install mysql or do t=
he above?
>
> -----Original Message-----
> From: Jochen Wiedmann [mailto:joe@ispsoft.de]
> Sent: 15 September 2003 14:18
> To: michael watson (IAH-C)
> Cc: 'perl@lists.mysql.com'
> Subject: Re: FW: Problems with mysql.sock
>
>
> michael watson (IAH-C) wrote:
>
> > My real problem is with DBI::mysql
>
> This is exactly what I was talking about. :-)
>
>
> > It's almost as if I have two versions of mysql on my machine, but I do=
n't.
>
> You have. :-) The location of the MySQL socket is compiled into the serv=
er,
> into the client library (for example libmysqlclient.a) and into the clie=
nt
> binaries (for example "mysqladmin" or "mysql"). Each of them *may* have =
a
> different location, which seems to be the case on your system.
>
>
> Jochen
>
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=3Dubo1@gmx.de
>


MfG
Ulrich Borchers

--
Dipl.-Inf. Ulrich Borchers
MEGABIT Informationstechnik GmbH
Karstr. 25, 41068 Mönchengladbach
Tel. +49 2161 30898-28



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 15:33:46 von Ulrich Borchers

quick and dirty:

cd /tmp
ln -s /var/lib/mysql/mysql.sock mysql.sock
(don't remember location of your .sock file)
But this is probably not supposed to be a good solution :-)

Uli

On 15 Sep 2003 at 14:20, michael watson (IAH-C) wrote:

> Ah, I see.
> I know I *can* specify the socket at runtime in DBD::mysql, but I am usi=
ng a whole load of someone else code, which doesn't specify the mysql sock=
et.... so unless I can get DBD::mysql to work with the socket default, i w=
ill have to do 1000s of find -> replaces to add the extra parameter to the=
calls to DBI->connect(). And then each time the software is updated, do =
it again.
>
> So what you seem to be saying is that I need to re-install mysql or do t=
he above?
>
> -----Original Message-----
> From: Jochen Wiedmann [mailto:joe@ispsoft.de]
> Sent: 15 September 2003 14:18
> To: michael watson (IAH-C)
> Cc: 'perl@lists.mysql.com'
> Subject: Re: FW: Problems with mysql.sock
>
>
> michael watson (IAH-C) wrote:
>
> > My real problem is with DBI::mysql
>
> This is exactly what I was talking about. :-)
>
>
> > It's almost as if I have two versions of mysql on my machine, but I do=
n't.
>
> You have. :-) The location of the MySQL socket is compiled into the serv=
er,
> into the client library (for example libmysqlclient.a) and into the clie=
nt
> binaries (for example "mysqladmin" or "mysql"). Each of them *may* have =
a
> different location, which seems to be the case on your system.
>
>
> Jochen
>
>
> --
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe: http://lists.mysql.com/perl?unsub=3Dubo1@gmx.de
>


MfG
Ulrich Borchers

--
Dipl.-Inf. Ulrich Borchers
MEGABIT Informationstechnik GmbH
Karstr. 25, 41068 Mönchengladbach
Tel. +49 2161 30898-28



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 16:40:04 von Rudy Lippan

On Mon, 15 Sep 2003, michael watson (IAH-C) wrote:

> Ah, I see. I know I *can* specify the socket at runtime in DBD::mysql,
> but I am using a whole load of someone else code, which doesn't specify
> the mysql socket.... so unless I can get DBD::mysql to work with the
> socket default, i will have to do 1000s of find -> replaces to add the
> extra parameter to the calls to DBI->connect(). And then each time the
> software is updated, do it again.
>
> So what you seem to be saying is that I need to re-install mysql or do
> the above?
>

I think what he is saying is that you need to recompile DBD::mysql against
a set of client librares that know which socket path to use. And you will
probably will want to compile a static version so that you are not at the
mercy of LD_LIBRARY_PATH and friends for findind the shared object.


Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

RE: FW: Problems with mysql.sock

am 15.09.2003 16:40:04 von Rudy Lippan

On Mon, 15 Sep 2003, michael watson (IAH-C) wrote:

> Ah, I see. I know I *can* specify the socket at runtime in DBD::mysql,
> but I am using a whole load of someone else code, which doesn't specify
> the mysql socket.... so unless I can get DBD::mysql to work with the
> socket default, i will have to do 1000s of find -> replaces to add the
> extra parameter to the calls to DBI->connect(). And then each time the
> software is updated, do it again.
>
> So what you seem to be saying is that I need to re-install mysql or do
> the above?
>

I think what he is saying is that you need to recompile DBD::mysql against
a set of client librares that know which socket path to use. And you will
probably will want to compile a static version so that you are not at the
mercy of LD_LIBRARY_PATH and friends for findind the shared object.


Rudy


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org