I did a search in here and found a answer, but could not get it to work. Can you please offer me some advice to help me solve this problem?

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

I did not put the @cpanel3165.hmp.com in the username, why is it adding it?
It even adds it if I put @myrealdomain.com!
I don't understand why it's adding it.

Here is my code, can you see the problem that is making it not be able to connect? I changed the REAL info of course, but You should get the idea:
#!/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();
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.

Any thing you see that I really need to modify?

Thank you much for ANYTHING you can share.

thx,
Richard

In reply to Remote Database Connection... in MySQL by powerhouse

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.