First time post and first use of perl. So please go easy on me if there is a simple fix to my problem.
Using the following script:
use lib '/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi/DBD'
+;
use DBI;
use mysql;
$hostname="localhost";
$db="database";
$port="3306";
$dbuser="username";
$dbpassword="password";
$table="table";
$DBI_DSN="dbi:mysql:database=$db;host=$hostname;port=$port";
$dbhandle = DBI->connect($DBI_DSN,$dbuser,$dbpassword,{ RaiseError =>
+1, AutoCommit => 0});
I get the following error:
DBI connect ('database=database;host=localhost;port=3306','username',.
+..) failed: Access denied for user: 'username@localhost.localdomain'
+(Using password: YES)...
I can connect from mysql command line with the username and password no problem. I can also connect via php from my website, but just not from perl.
I'm at a loss and have searched everywhere I know of for a clue to this, but can't find any discussion.
Any help would be much appreciated.
Thanks.
2004-12-02 Janitored by Arunbear - added code tags, as per Monastery guidelines
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.