mysql::DBD make problems - help plz
Complete newbie here - I have installed RH9 Perl 5 and mysql 4 (I've done all this before on Windoze but never Linux). The last step - getting perl to talk to mysql is posing a problem. I've got DBI installed ok but when I try to install the DBD I get...
"Unsuccessful stat on filename containing newline at /usr/lib/perl5/5.8.0/ExtUtils/Liblist/Kid.pm line 97. . . Many lines just like this. . . . Unsuccessful stat on filename containing newline at /usr/lib/perl5/5.8.0/ExtUtils/Liblist/Kid.pm line 97. Unsuccessful stat on filename containing newline at /usr/lib/perl5/5.8.0/ExtUtils/Liblist/Kid.pm line 97. Multiple copies of Driver.xst found in: /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBI at Makefile.PL line 286 Using DBI 1.37 installed in /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI Writing Makefile for DBD::mysql Makefile:89: *** missing separator. Stop. /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible Running install for module DBD::mysql Running make for J/JW/JWIED/DBD-mysql-2.1026.tar.gz Is already unwrapped into directory /root/.cpan/build/DBD-mysql-2.1026 Has already been processed within this session Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible Bundle summary: The following items in bundle Bundle::DBD::mysql had installation problems: Mysql DBD::mysql" I've looked at the Kid.pm but it's way beyond my understanding. Can anyone point me in the right direction please? Regards, Pigsy |
This turns out to be a bug in RH9 (apparently).
It can be worked around by setting an environment variable before doing the install: export LANG=C simple huh? Regards, Pigsy |
i am having same issue.
newbie to linux can you tell me how to change that environment variable?? where is file and where do i type it in the file?? anywhere??? please help!!!!!! |
Just type it at the console you are working from:
export LANG=C You may want to put it at the end of "/etc/bashrc" this will set it each time you log in. |
thanks!!!!!
for the help. ur the best. that got me past one part and now i need to figure out this other piece!! |
This got me past one error and into another (or a long list of errors):
dbdimp.c:373: initializer element is not constant dbdimp.c:373: (near initialization for `SQL_GET_TYPE_INFO_values[8]') dbdimp.c:378: `FIELD_TYPE_LONGLONG' undeclared here (not in a function) etc., etc. ... dbdimp.c:2311: dereferencing pointer to incomplete type (many of these) anyone know what is going on? Thanks! |
note I am using:
Redhat 9 DBD-mysql-2.9002 |
I just came up with similar errors on a RH9 box. setting LANG=C overcomes the initial problem, but then I get the following:
<snip> In file included from dbdimp.c:29: dbdimp.h:31:49: mysql.h: No such file or directory dbdimp.h:32:49: errmsg.h: No such file or directory In file included from dbdimp.c:29: dbdimp.h:116: parse error before "MYSQL" dbdimp.h:116: warning: no semicolon at end of struct or union dbdimp.h:127: parse error before '}' token dbdimp.h:156: parse error before "MYSQL_RES" dbdimp.h:156: warning: no semicolon at end of struct or union dbdimp.h:169: parse error before '}' token In file included from dbdimp.c:29: dbdimp.h:206: parse error before '*' token dbdimp.h:209: parse error before "MYSQL_RES" dbdimp.h:213: parse error before '*' token dbdimp.h:213: parse error before '*' token dbdimp.h:214: warning: data definition has no type or storage class dbdimp.c:131: parse error before '*' token dbdimp.c: In function `ParseParam': . . . </snip> So it looks like it's strugging to find some mysql headers, but beyond that I'm stumped. I'll continue to google for a solution tho. christo |
Try installing he mysql-devel package:
ftp://fr.rpmfind.net/linux/redhat/9/...4a-11.i386.rpm |
Sorry chaps - I should have replied back...
That's just what I did. Well I installed the devel package and also one other (can't remeber which, but it was a dep req for the devel rpm). Anyway, the DBD::Mysql installation no longer dies on missing libraries.. however, it attempts to run a test by connecting to a database (of it's own selection - the default mysql test database IIRC)... and it died with the old 'could not connect to mysq.sock' chestnut - however, I think that's prolly because I already had a mysqld process running. Anyway, it all satisfied my curiosity over this issue with installing the mysql bundle from CPAN and I left it at that. </ramble> christo :D |
I ran into the same problems mentioned in this thread using RH9 and mysql 4.0.14: Here is what I did to solve the problem with the help of this thread:
1) Did "export LANG=C" from bash shell 2) Add /usr/local/mysql/bin directory to the PATH, so that it can find mysql_config 3) Executed the following from bash shell perl Makefile.PL --cflags=-I/usr/local/mysql/include/mysql --libs="-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm" 4) For some reason the Makefile it generated did not have the correct include path for mysql 4.0.14. The Makefile had the include path of /usr/local/mysql/include/mysql which is incorrect according to my installation. I changed the include path to /usr/local/mysql/include Thanks everyone. Manoj. |
Just one more quick thing to note if anyone else is having issues installing DBD::Mysql.
The default testing procedures for the script connect to mysql as root@localhost with no password. So if your mysql has a password set you will come up with almost 95% test failure. I'm sure there are many ways to fix this but an easy way is to change you root pass to blank for the install. just remember to change it back ;) Hope That helps -Sam :Pengy: |
I succeeded in installing the Perl Module, DBD::mysql, on a Dell PC under
o Red Hat Linux 9.0 Professional o Perl 5.8.0 o MySQL 4.0.17 - Standard by the following procedure: Having installed MySQL I installed these two MySQL rpm's. MySQL-client-4.0.17-0.i386.rpm MySQL-devel-4.0.17-0.i386.rpm Then, at command-line, as "root" I executed these steps: a) set LANG to C via "export LANG=C" b) executed perl -MCPAN -e"install 'DBD::mysql'" >Log.txt 2>&1 This failed to complete the install, since the "test suite" failed. Error messages captured in Log.txt advised me to run "perl Makefile.PL --help" "find / -name Makefile.PL -print" revealed that there were several Makefile.PL's in my system. I selected /root/.cpan/build/DBD-mysql-2.9003/Makefile.PL which, from the names in its pathname, seemed to be appropriate. I then executed: perl /root/.cpan/build/DBD-mysql-2.9003/Makefile.PL --help The output advised me on how to set the options in the following command which were the subject of error messages in Log.txt above. c) perl /root/.cpan/build/DBD-mysql-2.9003/Makefile.PL \ --testdb=test \ --testuser=root \ --testpassword=< my MySQL root password > \ --testhost=localhost d) cd /root/.cpan/build/DBD-mysql-2.9003/ e) make f) make test g) make install On completing Step g), I executed perl -e"use DBD::mysql" which completed without any error messages, indicating that the install of mysql.pm had succeeded. I then ran one of my Perl programs, which "uses" DBD::mysql. It completed successfully. I do not develop as "root"; I develop as user "gene". When I logged in as "gene"; the same Perl program which user "root" ran successfully, failed with a message that DBD::mysql was inaccessible. As user "roo". I did a "find / -name mysql.pm -print >LS 2>&1" to locate all the mysql.pm modules in my system and then modified file LS to do an "ls -l " on each mysql.pm pathname. As user "gene", I executed ". ./LS". One of the pathnames was inaccesssible to "gene". I became user root again and chmod'ed this pathname to make it accessible to "gene"; logged back in as "gene" and found that everything worked perfectly. WARNING: In Step b) The mysql.pm directories that the "find" turns up in your system may be somewhat different from the ones in my system. One might rationally expect them to be the same, but, as my grandmother would say, "About such things who can tell?" I gather that perl -MCPAN -e"install DBD::mysql" >Log.txt 2>&1 ftp's the complete set of files necessary to install mysql.pm into your system; unzips the download; untar's the download; compiles the compilable parts of the download via the C compiler; and then uses the downloaded Makefile.PL to generate a make file complete the installation. But unless you have the right testuser, testpassword, testuser, etc., the make file doesn't work. That's the reason for Step c) above. In this developer's humble opinion, this is an extraordinarily opaque and error-prone procedure. I think perl -MCPAN -e" install 'DBD::mysql''" should be transparent to the user and with a little thoughtful design it probably could be made so. |
DBI doesn't install
What is wrong with Linux now? Nothing works, anymore. This is progress?
I have upgraded from RedHat 7.2 to Fedora Core1. I have installed the MySQL-devel, typed export LANG=C Try installing DBI, I type "make" and I get this: gcc -c -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -march=i386 -mcpu=i686 -DVERSION=\"1.42\" -DXS_VERSION=\"1.42\" -fPIC "-I/usr/lib/perl5/5.8.1/i386-linux-thread-multi/CORE" -Wall -Wno-comment Perl.c /bin/sh: line 1: gcc: command not found Any suggestions? Do I have to reinstall gcc. |
You can't really blame "linux" for this. Linux is ust the kernel.
I seriously doubt if you need to reinstall gcc, most likely you need to install it in the first place. If gcc is installed then make sure that it's location is included in your PATH variable: echo $PATH |
All times are GMT -5. The time now is 10:00 PM. |