473,396 Members | 1,693 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,396 software developers and data experts.

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

JL
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
----- ----- -----
[client]
socket = /opt/mysql_root/sock/mysql.sock
....
[mysqld]
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

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);
--

to

--
$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 6486

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

Similar topics

0
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...
0
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...
0
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...
1
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...
1
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...
4
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...
1
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 { ...
1
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.