Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 52428
Status: rejected
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: mrp.ashok [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



-- CPAN fan & plan for new modules in future.
When I try to work with DBI(latest), CGI(latest), Apache(2.2.14) and MySQL(5.0), Perl 5.10 together in Windows, I get the below problem for DBI connect. connect('database=:host=','',...) failed: Access denied for user 'ODBC'@'localhost' (using password: NO). However, I am able to connect to mysql by root id on command prompt directly & also throw a normal script without CGI. However CGI as such no problem. It only gives problem when CGI tries to connect to DB. File t.cgi content, use DBI; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; my ($db, $host, $user, $pswd, $tbl) = param(); # cgi function. my %f; foreach my $p (param()) { $f{$p} = param($p); } #connect to MySQL database my $dbh = DBI->connect ( "DBI:mysql:database=".$f{$db}.":host=".$f{$host}, $f{$user}, $f{$pswd}, { RaiseError => 1, AutoCommit => 0 } ) or die "Can't connect to database: $DBI::errstr\n"; #prepare the query my $sth = $dbh->prepare( "SELECT * FROM ".$f{$tbl}) or die "Cannot select from table :: errstr\n"; #execute the query $sth->execute( ); # Retrieve the results of a row of data and print print header; print start_html("MySql DB query result"); while ( my @row = $sth->fetchrow_array( ) ) { print "@row\n<br>"; } print end_html; warn "Problem in retrieving results", $sth->errstr( ), "\n" if $sth->err( ); #disconnect from database $dbh->disconnect or warn "Disconnection error: $DBI::errstr\n"; exit; Thanks/Regards, Ashok
Subject: DBI module for ODBC user problem.
After creating a user of ODBC with root authentication, it is sorted out. My worry is that In long run, any update with this id should sustain similar to root. That I could see once I progress. As of now this should be cancelled.
OK. Thanks.