473,236 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 software developers and data experts.

DBD:mysql doesn't read mysql option file /etc/my.cnf file

Platform: Linux Red Hat RHEL 3 (and red hat 9)

Installed MySQL from source. As a matter of fact, installed all LAMPS
from source, and the mysql socket file was arranged in a place other
than /tmp/mysql.sock. Let's say, /opt/mysql_root/sock/mysql.sock.
Installed DBI without any problem.

In /etc/my.cnf there are lines as
----- ----- -----
socket = /opt/mysql_root/sock/mysql.sock
socket = /opt/mysql_root/sock/mysql.sock
----- ----- -----
The access rights issues to the directory was taken care off.
The problem came when installing DBD::mysql from source.

perl Makefile.Pl

make test => problem begins:

----- excerpt -----
.... error: ..."can't connect to local mysql server through socket
/tmp/mysql.sock" ...

.... [Error 2]

------ end ------

I have built everything from source, so there shouldn't be a problem of
"mysql server was built with binary and the others were built with
different packages, such as using the package from Linux o/s, etc."
And the mysqld was running while DBD installation was being progressed.

I didn't have problem with shell command line connecting to the server,
and code in PHP that connects to the server worked fine.

It seems that DBD::mysql doesn't (or doesn't have the intelligence to)
check /etc/my.cnf file when starting mysql client. I have tried

# ln -s /opt/mysql_root/sock/mysql.sock /tmp/mysql.sock

and the problem was solved. I prefer not to use this method.

Maybe rebuilding mysql with
"--with-unix-socket-path=/opt/mysql_root/sock/mysql.sock" will solve
the problem?

Or, setting shell variable
"MYSQL_UNIX_PORT=/opt/mysql_root/sock/mysql.sock" will do, too. So in
perl code, before we start db connection, we can set
$ENV{'MYSQL_UNIX_PORT'} = "/opt/mysql_root/sock/mysql.sock"?

I am trying to solve this problem at the system building phase, and to
avoid having to modify the original perl code, for example, from:
$dsn = "DBI:mysql:test";
$dbh = DBI->connect($dsn, $user, $password);


$dsn = "DBI:mysql:test;mysql_read_default_group=clien t;"
. "mysql_read_default_file=/usr/local/mysql/data/my.cnf";
$dbh = DBI->connect($dsn, $user, $password);

so that the old perl code can be ported to the newly installed system
without modification.

Appreciate your expertise
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 19 '05 #1
0 6470

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Randell D. | last post by:
Folks, I have installed MySQL v4 (client, server and development rpm's). I've tried and failed to use the recommended mysqladmin to set a root password after the installation (I have another post...
by: Yun Guan | last post by:
Hello mysql gurus, I am trying to run perl on mysql database on Red Hat box. I want to install DBI and DBD:mysql using CPAN: perl -MCPAN -e shell cpan>install DBI The above succeeded, but...
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
by: Alex Hunsley | last post by:
I am trying to install the DBD::mysql perl module. However, it claims I need mysql.h: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /home/alex/.cpan/Metadata Database was...
by: smsabu2002 | last post by:
Hi, I am facing the build problem while installing the DBD-MySql perl module (ver 2.9008) using both GCC and CC compilers in HP-UX machine. For the Build using GCC, the compiler error is...
by: Larry | last post by:
I have a Perl script using DBD::DB2, that runs during system startup on a Solaris system. The script is working fine during startup on many machines, except on one machine it fails complaining...
by: chaosbuddha | last post by:
Hi! I am trying to set-up mysql-zrm to take backups of a remote mysql server. The mysqlhotcopy command is throwing up the following error: Output of command: 'mysqlhotcopy' is { ...
by: Robert Kulseth | last post by:
perl version v5.8.9 built for darwin-2level mysql Ver 14.14 Distrib 5.5.8, for osx10.6 (i386) using readline 5.1 DBD-mysql-4.018 DBI version 1.615 Mac OS X version 10.6.5 I have been...
by: Francesca | last post by:
Hi everybody, I am a real newbie in both perl and relational databases like mysql, and I have been banging my head on the wall trying to understand how to populate a mysql database using an Excel...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.