perl with DBD::mysql problems

  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

hi all, i'm trying to install a thing that requires this module, that miss (look):
>>> STEP: Verifying required perl modules ...
Searching for required perl modules ...
x = module installed
[x] DBI v1.48
[ ] DBD::mysql v????
[x] Data::Dumper v2.12

so.. i stop this, and try to install the missing module, when i made MAKE i have this problem:

[root@localhost DBD-mysql-2.9004]# perl Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help


i try a lot of this to resolve that.. but i cant.. :\ anyone can help me ? :\

thks, regards
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

I would try to install it via the MCPAN directive;
Code: [ Select ]
perl -MCPAN -e shell
 install DBD::mysql
  1. perl -MCPAN -e shell
  2.  install DBD::mysql


However, your install can't seem to locate the mysql config (obviously). Odd question, but you do have mysql installed and configured... right?

In essence, the new makefile cannot source the config for mysql, which means it is not in one of the standard places for binaries (/usr/bin, /usr/local/bin, etc.).
You could run a 'find' and symlink or copy it into one of those above.
You have the option, if you install via cpan, to go into your build dir (~/.cpan/build/<source>) and run MakeFile.PL with the proper user-specified flags to source the proper dir tree.

Cheers.
  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

Daemonguy wrote:
I would try to install it via the MCPAN directive;
Code: [ Select ]
perl -MCPAN -e shell
 install DBD::mysql
  1. perl -MCPAN -e shell
  2.  install DBD::mysql




Quote:
[root@localhost .cpan]# perl -MCPAN -e shell
Undefined value assigned to typeglob at (eval 15) line 15, <RC> line 11.
Warning [/etc/inputrc line 11]:
Invalid variable `mark-symlinked-directories'

cpan shell -- CPAN exploration and modules installation (v1.76)
ReadLine support enabled

cpan> install DBD::mysql
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Mon, 28 Mar 2005 13:53:38 GMT
Running install for module DBD::mysql
Running make for R/RU/RUDY/DBD-mysql-2.9004.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /root/.cpan/sources/authors/id/R/RU/RUDY/DBD-mysql-2.9004.tar.gz ok
Scanning cache /root/.cpan/build for sizes
DBD-mysql-2.9004/
DBD-mysql-2.9004/t/
DBD-mysql-2.9004/t/mysql2.t
DBD-mysql-2.9004/t/akmisc.t
DBD-mysql-2.9004/t/60leaks.t
DBD-mysql-2.9004/t/10dsnlist.t
DBD-mysql-2.9004/t/ak-dbd.t
DBD-mysql-2.9004/t/50chopblanks.t
DBD-mysql-2.9004/t/mysql.t
DBD-mysql-2.9004/t/lib.pl
DBD-mysql-2.9004/t/40blobs.t
DBD-mysql-2.9004/t/40nulls.t
DBD-mysql-2.9004/t/insertid.t
DBD-mysql-2.9004/t/40listfields.t
DBD-mysql-2.9004/t/40bindparam.t
DBD-mysql-2.9004/t/mysql.dbtest
DBD-mysql-2.9004/t/dbdadmin.t
DBD-mysql-2.9004/t/20createdrop.t
DBD-mysql-2.9004/t/00base.t
DBD-mysql-2.9004/t/30insertfetch.t
DBD-mysql-2.9004/t/40numrows.t
DBD-mysql-2.9004/t/50commit.t
DBD-mysql-2.9004/t/mysql.mtest
DBD-mysql-2.9004/MANIFEST
DBD-mysql-2.9004/myld
DBD-mysql-2.9004/dbdimp.c
DBD-mysql-2.9004/lib/
DBD-mysql-2.9004/lib/DBD/
DBD-mysql-2.9004/lib/DBD/mysql/
DBD-mysql-2.9004/lib/DBD/mysql/GetInfo.pm
DBD-mysql-2.9004/lib/DBD/mysql/INSTALL.pod
DBD-mysql-2.9004/lib/DBD/mysql.pm
DBD-mysql-2.9004/lib/Mysql/
DBD-mysql-2.9004/lib/Mysql/Statement.pm
DBD-mysql-2.9004/lib/Bundle/
DBD-mysql-2.9004/lib/Bundle/DBD/
DBD-mysql-2.9004/lib/Bundle/DBD/mysql.pm
DBD-mysql-2.9004/lib/Mysql.pm
DBD-mysql-2.9004/dbdimp.h
DBD-mysql-2.9004/mysql.xs
DBD-mysql-2.9004/MANIFEST.SKIP
DBD-mysql-2.9004/README
DBD-mysql-2.9004/INSTALL.html
DBD-mysql-2.9004/META.yml
DBD-mysql-2.9004/Makefile.PL
DBD-mysql-2.9004/ChangeLog
DBD-mysql-2.9004/constants.h
DBD-mysql-2.9004/TODO
Removing previously used /root/.cpan/build/DBD-mysql-2.9004

CPAN.pm: Going to build R/RU/RUDY/DBD-mysql-2.9004.tar.gz

Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

perl Makefile.PL --help
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install


---


Daemonguy wrote:

However, your install can't seem to locate the mysql config (obviously). Odd question, but you do have mysql installed and configured... right?



lol yes i have it.. :)

---

Daemonguy wrote:
In essence, the new makefile cannot source the config for mysql, which means it is not in one of the standard places for binaries (/usr/bin, /usr/local/bin, etc.).
You could run a 'find' and symlink or copy it into one of those above.
You have the option, if you install via cpan, to go into your build dir (~/.cpan/build/<source>) and run MakeFile.PL with the proper user-specified flags to source the proper dir tree.

Cheers.


i have mysql installed at /usr/local/mysql/
i dont find that file now.. but one time i already try to copy the file and put the file on the dir and does not work.
do you know wich flag is ? :S lol

thks for answer! :)
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

[PT]volumes wrote:
Daemonguy wrote:
In essence, the new makefile cannot source the config for mysql, which means it is not in one of the standard places for binaries (/usr/bin, /usr/local/bin, etc.).
You could run a 'find' and symlink or copy it into one of those above.
You have the option, if you install via cpan, to go into your build dir (~/.cpan/build/<source>) and run MakeFile.PL with the proper user-specified flags to source the proper dir tree.

Cheers.


i have mysql installed at /usr/local/mysql/
i dont find that file now.. but one time i already try to copy the file and put the file on the dir and does not work.
do you know wich flag is ? :S lol

thks for answer! :)


As I stated above, you can symlink to it as well. Run the 'find', and symlink.

Cheers.
[/code]
  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

finally i did it! LOL!

DBD::mysql is isntalled.. now i have another problem LOL look:

Code: [ Select ]
Checking for DB ps_stats@localhost ...ERROR
Unable to connect to database. See error below for details.
-------------------------------------------------------------------------------
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
-------------------------------------------------------------------------------
ERROR EXPLAINATION:
The host you've entered: 'localhost' does not appear to be a valid DB server.
  1. Checking for DB ps_stats@localhost ...ERROR
  2. Unable to connect to database. See error below for details.
  3. -------------------------------------------------------------------------------
  4. Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
  5. -------------------------------------------------------------------------------
  6. ERROR EXPLAINATION:
  7. The host you've entered: 'localhost' does not appear to be a valid DB server.


lol now i have no ideia what is the problem here... its wierd cuz i have mysql installed at /usr/local/mysql :roll:

even if i try to connect do mysql he gave me the smae error :s
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

That error means you are trying to connect via a Unix socket ( it does this when you do not specify a hostname to connect to or use localhost -- I am guessing the latter).

The most common reason for this error is no running mysqld; do you have mysqld running? Just installing mysql does not imply that the daemon (mysqld) is running.
Check for it by doing the following;
Code: [ Select ]
#> mysqladmin version
#> mysqladmin variables
#> mysqladmin -h `hostname` version variables
#> mysqladmin -h `hostname` --port=3306 version
#> mysqladmin -h host_ip version
#> mysqladmin --protocol=socket --socket=/tmp/mysql.sock version
  1. #> mysqladmin version
  2. #> mysqladmin variables
  3. #> mysqladmin -h `hostname` version variables
  4. #> mysqladmin -h `hostname` --port=3306 version
  5. #> mysqladmin -h host_ip version
  6. #> mysqladmin --protocol=socket --socket=/tmp/mysql.sock version


There's other reasons, but as I said, this is most common.

Cheers.
  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

Daemonguy wrote:
That error means you are trying to connect via a Unix socket ( it does this when you do not specify a hostname to connect to or use localhost -- I am guessing the latter).

The most common reason for this error is no running mysqld; do you have mysqld running? Just installing mysql does not imply that the daemon (mysqld) is running.
Check for it by doing the following;
Code: [ Select ]
#> mysqladmin version
#> mysqladmin variables
#> mysqladmin -h `hostname` version variables
#> mysqladmin -h `hostname` --port=3306 version
#> mysqladmin -h host_ip version
#> mysqladmin --protocol=socket --socket=/tmp/mysql.sock version
  1. #> mysqladmin version
  2. #> mysqladmin variables
  3. #> mysqladmin -h `hostname` version variables
  4. #> mysqladmin -h `hostname` --port=3306 version
  5. #> mysqladmin -h host_ip version
  6. #> mysqladmin --protocol=socket --socket=/tmp/mysql.sock version


There's other reasons, but as I said, this is most common.

Cheers.


sorry but i'm a little newbie at this.. i try to do what u said bue appears this:

[root@localhost bin]# mysqladmin version
-bash: mysqladmin: command not found

:roll:

"That error means you are trying to connect via a Unix socket ( it does this when you do not specify a hostname to connect to or use localhost -- I am guessing the latter). "

i try to connect with the ip (127.0.0.1 or 192.168.0.183) and show the same error..
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

[PT]volumes wrote:

sorry but i'm a little newbie at this.. i try to do what u said bue appears this:

[root@localhost bin]# mysqladmin version
-bash: mysqladmin: command not found

:roll:

"That error means you are trying to connect via a Unix socket ( it does this when you do not specify a hostname to connect to or use localhost -- I am guessing the latter). "

i try to connect with the ip (127.0.0.1 or 192.168.0.183) and show the same error..


Ok, well there you go. You don't have mysqld running.
Try
Code: [ Select ]
mysqld_safe &


Mysqld is the daemon process that accepts connections to the DB.

Cheers.
[/code]
  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

OMFG now mysql dont run! since i installed the module its error behind error... :s omfg

sorry again, can u teel wtf is this ?

Code: [ Select ]
[root@localhost bin]# mysqld_safe &
[1] 2788
-bash: mysqld_safe: command not found
  1. [root@localhost bin]# mysqld_safe &
  2. [1] 2788
  3. -bash: mysqld_safe: command not found



thks u for all ur pacience to help me!
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Uh, do a find for that filename.

If you can't find it, mysql is not even installed, or not installed properly. It should have placed that startup script into a standard executable dir in your path.

Find it; if you do, run with full pathname. (ex. /usr/local/bin/mysqld_safe &)

If you do not find it, I suggest you start over; go to the mysql website and follow the instructions contained therein to get mysqld installed.
On a side note, they also have some post-install config options -- like removal of default root access -- which I suggest you make use of.

Cheers.
  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

i don know what to do now... i re-install red hat, install apache mysql php, and it all works, now i install the modules that miss and start gave me that error... nothing works now... :s
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Which mysql? mysql-client or mysql-server?
You need to install server.
Go to the mysql website and get the source.
If you never had mysqld running, it never worked. The webserver itself answered I am sure, but it never connected to the db.

Again, you must have mysqld running in order for your php to connect to it via the local socket.

Re-installing the OS is not going to help.

I am not sure how to say it more plainly.

Cheers.
  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

Daemonguy wrote:
Which mysql? mysql-client or mysql-server?
You need to install server.
Go to the mysql website and get the source.
If you never had mysqld running, it never worked. The webserver itself answered I am sure, but it never connected to the db.

Again, you must have mysqld running in order for your php to connect to it via the local socket.

Re-installing the OS is not going to help.

I am not sure how to say it more plainly.

Cheers.


MySql server... dwd when i reinstall the OS, i start to install apache,mysql and php... and it all works... i create, delete, etc data, then i put the red hat cd at boot, and i made an upgrade, and install the libdbd-mysql and the dbi drivers that need.. reboot the system and now i try to run mysql server and appears that error... even connnect i cant... :s
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

I suggest you read this;
http://www.webdevelopersnotes.com/tutor ... orial.php3

You MUST have mysqld (the server) running.
  • [PT]volumes
  • Novice
  • Novice
  • [PT]volumes
  • Posts: 28

Post 3+ Months Ago

hey,

i installed apache, mysql and php with this tuturial :

http://www.hostlibrary.com/installing_a ... p_on_linux
and everything works nice, when a isntall the module mysql stop working.. :s

there's anything wrong there ?
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Are you sure when you do this step;
Quote:
/usr/local/mysql/bin/mysqld_safe –user=mysql &

That it is actually running?

Type;
Code: [ Select ]
ps -aef |grep mysql


If nothing returns, it's not running to begin with.

Let's start there.

Post Information

  • Total Posts in this topic: 16 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.