hazards has asked for the wisdom of the Perl Monks concerning the following question:
whereas#!/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;
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?/path/to/user/mysql/bin/mysql -u first -p
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I direct DBI::mysql to a particular mysql instance
by pc88mxer (Vicar) on Jul 18, 2008 at 21:26 UTC | |
by hazards (Initiate) on Jul 21, 2008 at 17:56 UTC | |
|
Re: How do I direct DBI::mysql to a particular mysql instance
by bradcathey (Prior) on Jul 18, 2008 at 21:16 UTC |