rvosa has asked for the wisdom of the Perl Monks concerning the following question:
But all I get is:my $dsn = 'DBI:mysql:ciprestest:localhost'; my $dbuser = 'cipresquery'; my $dbpass = 'iamstupid'; my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "Couldn't connect to database: " . DBI->errstr;
In other words, the user name ($dbuser) and password ($dbpass) I define seem to be ignored when DBI tries to connect, and it uses my cygwin user name (rvosa) instead. Everything works fine when I connect to mysql from the terminal: mysql -u cipresquery -p'iamstupid' ciprestest and the script does connect when I change the mysql privileges so that user name and password aren't required but that's obviously not what I want. What could be going on? I tried different permutations for quotes around the DBI->connect() arguments, concatenated them all separated by colons, tried "user=cipresquery" for $dbuser and so on but to no avail.DBI connect('database=ciprestest;host=127.0.0.1;port=3306','',...) fai +led: Access denied for user: 'rvosa@localhost' (Using password: NO)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI confusion
by jaco (Pilgrim) on Apr 13, 2004 at 23:44 UTC | |
|
Re: DBI confusion
by blue_cowdawg (Monsignor) on Apr 14, 2004 at 00:53 UTC | |
|
Re: DBI confusion
by tantarbobus (Hermit) on Apr 13, 2004 at 23:45 UTC |