DBD::MySQL

Discussion in 'PSA 2.5 HOWTO' started by Seven, Nov 9, 2001.

  1. Seven

    Seven Guest

    Has anyone been able to install the DBD drivers for mysql? I am running RH Linux 7.1. I downloaded the DBI module from cpan and they installed fine. I then downloaded the DBD module and tried to run perl Makefile.PL but got an error:

    Can't locate DBI/DBD.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at Makefile.PL line 5.

    Is there a way to solve this without adding the path to DBI in Makefile.PL?
     
  2. jchoi

    jchoi Guest

    I have the same problem.

    This is not the answer for your question.

    I got the similar error log when I tried to use "use DBI" for mySQL database. DBI.pm and other library files and modules are in a different location, all under psa instead of under /usr/bin/.

    modules like "DBI::DBD.3pm" can be found under "/usr/local/psa/apache/lib/perl/man/man3"

    And library files like DBI.pm and other folders are here "/usr/local/psa/apache/lib/perl/site_perl/5.005/i386-linux".

    I don't know how to use "use DBI" and other modules for some of my cgi programs. I have a lot of headache these days. :confused:

    If you can have solution, plese share the knowledge with me.;)

    Thanks and take care.

    -jaemin-
     
  3. kark

    kark Guest

  4. Seven

    Seven Guest

    I emailed support and Bryan gave instructions on how to install the perl DBI and DBD modules (see below). Apparently the DBI/DBD modules that are installed with PSA are for mod_perl not perl.

    ====================

    1. Download DBI module from CPAN:
    # ncftpget
    ftp://ftp.cpan.org/pub/CPAN/authors/id/T/TI/TIMB/DBI-1.20.tar.gz
    2. Uncompress DBI module archive:
    # gunzip -c DBI-1.20.tar.gz |tar xvf -
    3. Change directory to DBI-1.20
    # cd DBI-1.20
    4. Configure DBI modules:
    # perl Makefile.PL
    5. Make and install DBI modules:
    # make && make install



    Msql-Mysql modules installation:


    1. Download Mysql modules from the CPAN:
    # ncftp
    ftp://ftp.cpan.org/pub/CPAN/authors/id/J/JW/JWIED/Msql-Mysql-modules-1.2
    219.tar.gz
    2. Uncompress Mysql modules:
    # gunzip -c Msql-Mysql-modules-1.2216.tar.gz |tar xvf -
    3. Change directory to Msql-Mysql-modules-1.2216
    # cd Msql-Mysql-modules-1.2216
    4. Configure Mysql modules
    # perl Makefile.PL


    answer questions:
    a) Which drivers do you want to install?


    1) MySQL only
    2) mSQL only (either of mSQL 1 or mSQL 2)
    3) MySQL and mSQL (either of mSQL 1 or mSQL 2)


    4) mSQL 1 and mSQL 2
    5) MySQL, mSQL 1 and mSQL 2


    Enter the appropriate number: [3]


    Answer '1'.



    b) Do you want to install the MysqlPerl emulation? You might keep your
    old
    Mysql module (to be distinguished from DBD::mysql!) if you are concerned
    about compatibility to existing applications! [n]


    Answer 'n'



    c) Where is your MySQL installed? Please tell me the directory that
    contains the subdir 'include'. [/usr/local]


    Answer '/usr/local/psa/mysql'



    d) Answer with default answer to any other questions



    5. Make and install modules
    # make && make install


    ==========
     
  5. jchoi

    jchoi Guest

    Seven! You are lucky Seven!!!

    Seven,

    Your explanation was so thorough that I could easily follow the instruction and...that's it! It perfectly worked!

    I'm so happy now because I can finally use one of my program's "use DBI" mode to store data in mySQL database.

    Thank you so much for sharing the information you hardly got and I appreciate that you didn't forget me, who wanted you to share any information regarding this problem.

    Best Regards,

    -jaemin-
     
  6. Snoozy

    Snoozy Guest

    That doesn't work on an RPM installtion.
     
  7. serve-you.net

    serve-you.net Guru

    Messages:
    1,896
    There is a DBI rpm.

    -Dan
     
  8. Snoozy

    Snoozy Guest

    Turns out I was missing part of my plesk installtion!?
     
  9. Scott

    Scott Guest

    Works perfect!

    Seven,

    I realize this may bring up an old thread, but its one that will always come in handy.

    Your instructions were right on, and everything loaded up fine on our FreeBSD server.

    Thanks for checking into it and posting the info!
     
  10. jtinholt

    jtinholt Guest

    Does DBD::mysql get installed also?

    Does DBD::mysql get installed with Mysql-Mysql-modules? I also did this on a Redhat 7.1 system without a hitch. Do I still need to install DBD::mysql?

    John
     
  11. Seven

    Seven Guest

    DBD::mysql should already be installed.
     
  12. jchoi

    jchoi Guest

    both yes or no I think...

    You will never know before you really try "use DBI" in your script to use MySQL. I had installed mysql-mysql-modules first but "use DBI" caused "Interal Server Error" on my Plesk server when I ran my script. So I installed DBI module WITHOUT any problem but had problem installing DBD module. Thanks to Seven, I could eventually install the module.

    I think the best stragy is that don't bother untill you get an error regarding "use DBI". If you get the error in the future, then you can come back to this forum and follow the exact steps that Seven and I followed.

    Take cart,

    -jaemin-
     
  13. jtinholt

    jtinholt Guest

    Thanks Guys!!

    I was getting the server error and I did follow the steps as Seven suggested. It just seemed to easy that's all! I'll try my script again and see if things are working now.

    Thanks again you guys are great.

    John
     
  14. aaljonaid

    aaljonaid Guest

    If I want those modules to be installed in the sever for all domains! Do I need to performe those instruction as a root? or just under the main domain?

    If as a root, do I install 'em while I am in / directory? or this doesn't really matter?

    Thank you very much in advance,
    Ahmed
     
  15. jtinholt

    jtinholt Guest

    I installed as root from the root directory. I'm not really sure if it
    matters what directory you are in... maybe someone else can
    comment on this.

    The modules get added to your perl configuration so they will be
    available to all domains on your server.

    John
     
  16. aaljonaid

    aaljonaid Guest

    Thanks John!

    Is there anyway to see if the installation was successful other than running scripts that needs those modules?

    I have a script called (helper.cgi) which showes all the modules that are installed in the server along with some more info! but I can't see for example Msql ,Msql::Integrat and Msql::Statement !! Where those upposed to be instaled when I installed Msql-Mysql-module ? or do I need another module for that?

    Here, some of the results I get from helper.cgi regarding Mysql and DBD:

    DBD::ExampleP DBI::proxyServer
    DBI::Shell Mysql
    DBD::NullP Mysql::Statement
    DBD::proxy
    DBD::Sponge
    DBD::mysql
    DBI
    DBI::FAQ
    DBI::Format

    Thank you ,
    Ahmed
     
  17. jtinholt

    jtinholt Guest

    I have a perl script called MasterPreInstallationTester that will tell you many of your perl environment variables plus you can ask it to check if specific modules are installed. It's very handy. It's a free download. You can get it at

    http://willmaster.com/master/pit/index.shtml

    Regards,
    John
     
  18. jchoi

    jchoi Guest

    installing modules in your default admin home will be just fine.

    If you telnet or ftp to your server, you are directed to your default admin home folder. Follow these simple steps:
    1. Upload all the modules to that defaul area (admin/home).
    2. Change your right to superuser(root) using "su" command.
    3. Install the moduls following the instructions of the installers.

    You have to first be a "superuser (root)" to overwrite or install
    modules, esp. overwrite the existing files.

    Installing modules once to your server affect all domains on your server.

    Hope it will work for you.

    -jaemin-
     
  19. PaulC

    PaulC Guru

    Messages:
    1,479
    If you are using FreeBSD, you can install the modules from the ports collection, and it installs all the required modules for you.

    To do it just follow this:

    cd /usr/ports/databases/p5-Mysql
    make install clean

    It's that simple....

    One thing to ensure is that you have disabled mod_perl within the hosting section, as it will ignore the new module otherwise.

    Cheers,
    Paul
     
  20. ventrue21

    ventrue21 Kilo Poster

    Messages:
    51
    ports

    The Freebsd ports are my best friends.

    Live was made very simple because of these ports.
    You can also use Cpan.
     

Share This Page