List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 12 2003 10:15pm
Subject:Re: unworking directive --with-unix-socket-path=/
View as plain text  
At 17:04 -0500 3/12/03, Slawomir Orlowski wrote:
>Hello,
>  I have RH 6.1.
>  I have mysql 3.22.25 version binary installation
>  databases are in /var/lib/mysql
>  binaries in /usr/bin/mysql etc
>  /var/lib/mysql/mysql.pid
>  /var/lib/mysql/mysql.sock
>  and rpm packages:
>  perl-DBI-1.13-1,
>  perl-DBD-mysql-mysql-1.22.10-1
>  perl-5-5.0050
>  and binary installation of php 4.04pl
>  and it was working perfectly (I have web page written in php and perl),
>
>two day ago I have installed from source (to old RH to get binary
>  installation) mysql 3.23.55.
>  It compiled perfectly and was installed in
>  /usr/local/mysql
>  databases in
>  /usr/local/mysql/var
>/tmp/mysql.sock
>
>  I have stoped old mysql server and run new one.
>
>  I could connect with new /usr/local/mysql/bin/mysql client (old one was not
>  working) and select data from moved databases.
>  problem is that web pages are not working any more,
>  after running by hand some script (which use to work) I'm getting:
>  "
>  Date::Parse is not available but requested by Class::Date
>  DBI->connect(database=class;host=localhost) failed: Can't connect to local
>  MySQL server through socket '/var/lib/mysql/mysql.sock' (111) at ./class
>  line 27
>  Can't call method "prepare" on an undefined value at ./class line 156.
>  "
>  it looks to me that that it somehow is trying to connect to old not working
>  mysql database.
>  because now mysql.sock is in /tmp/mysql.sock
>  I have found somewhere that pearl script I can add directive:
>  mysql_read_default_file
>  $dbh = DBI->connect("DBI:mysql:$database"
>  . ";mysql_read_default_file=$ENV{HOME}/.my.cnf",
>  $user, $password);
>  I did and it worked, but I do not know what to do in php scripts (I do not
>  know php I'm admin) and it is daunting job to change manually all perl
>  scripts.
>
>so far my problems my faults:
>but now we have bug:
>------------------------------------
>bacause I have problem with mysql.socket which was in old version in
>/var/lib/mysql now in /tmp
>
>so
>
>  ./configure --prefix=/usr/local/mysql \
>--with-unix-socket-path=/var/lib/mysql/mysql.sock
>make;make install etc.
>
>should produce mysql with socket in /var/lib/mysql dictionary instead of
>/tmp
>but once again I have got socket in /tmp/mysql.sock
>
>So this directive is not working.
>
>I have solved my problem by replacing in /etc/my.conf
>socket = /tmp/mysql.sock
>with
>socket          = /var/lib/mysql/mysql.sock
>
>and now it is working.
>But it does not change the fact that
>directive --with-unix-socket-path=/var/lib/mysql/mysql.sock is not working.

It does work, I use it all the time to specify where the socket file
for each of my several-dozen-different-servers should be. :-)

However, after you recompile MySQL (and the client library), you'll also
need to rebuild DBD::mysql and PHP so that they link in the new client
library.  For PHP, you can also specify the socket path in your php.ini
file if you don't want to recompile:

mysql.default_socket = /path/to/socket/file;

>
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <mysql-thread134581@stripped>
>To unsubscribe, e-mail <mysql-unsubscribe-paul=snake.net@stripped>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
unworking directive --with-unix-socket-path=/Slawomir Orlowski12 Mar
  • Re: unworking directive --with-unix-socket-path=/Paul DuBois12 Mar
  • built in HARenato Golin13 Mar
  • Re: unworking directive --with-unix-socket-path=/Andreas24 Mar
    • Output data to fileScott Haneda24 Mar
      • Re: Output data to fileIvan Paul24 Mar
      • re: Output data to fileEgor Egorov24 Mar