powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
Software error: DBI connect('database=DB_Name;host=I_Had_IP_Here','USER_HERE','USER_PW +_HERE') failed: Access denied for user: 'USER_HERE@cpanel3165.hmp.com +' (Using password: YES) at test.cgi line 7
That gets the error at the top of this page. I've tried lots of different things. On the HOST I'm trying to access, I even added the main server name(hmp.com) as a host allowed to access the database. I added a new user and granted it permission to access that database and so forth.#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard :cgi-lib); use DBI; use strict; my $dbh = DBI->connect("DBI:mysql:database=DATABASE_NAME;host=10.10.10 +.10", "USER_HERE", "USER_HERE_PW", {'RaiseError' => 1}) or die $DBI->errstr; my $sth = $dbh->prepare (qq{ SELECT some_cell FROM `table_name` }) +; $sth->execute(); my $_content; while($_cell_whatever = $sth->selectrow_array()) { $_content .= $_cell_whatever . br() . "\n"; } $sth->finish(); print header(), start_html(), $_content, end_html();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remote Database Connection... in MySQL
by tachyon (Chancellor) on Oct 22, 2003 at 10:23 UTC | |
|
Re: Remote Database Connection... in MySQL
by edan (Curate) on Oct 22, 2003 at 07:08 UTC |