I am working in a small cluster with two instances of MYSQL. One MYSQL is used by the cluster head node for keeping track of the compute nodes. We installed another instance of MYSQL (different version,different path, different port) for general use. Our efforts to use DBI::mysql to connect to the general are not working. Some code
#!/usr/bin/perl -w use strict; use DBI; my $host = 'localhost:3309'; my $db = 'fdb'; my $db_user = 'first'; my $db_password = 'firstpasswd'; my $dbh = DBI->connect("dbi:mysql:$db:$host", "$db_user", "$db_password") or die "Couldn't connect to database: ".DBI->er +rstr;
whereas
/path/to/user/mysql/bin/mysql -u first -p
works fine. That is the user and password are in fact correct. Users can access the database with regular MYSQL commands. The PERL script above returns "Couldn't connect to database: Access denied for user 'first'@'localhost (using password:YES)" which is what happens when I enter the wrong password in the mysql command line case. So, I think the DBI::MYSQL, as I am using it, is trying to connect to the /usr/bin/mysql not to the /path/to/user/mysql/ which is where I want it to go. How do I tell DBI::mysql which mysql to connect to?

In reply to How do I direct DBI::mysql to a particular mysql instance by hazards

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.