can anyone tell me what am i doing wrong here. i'm trying to connect remotely to the MySQL database on a server (SunOS multivac 5.9 sparc SUNW,Sun-Fire-V240). i know that the username and the password are correct, but it keeps giving me this error:
DBI connect('mydb:m yhostname:1234' ,'username',... ) failed: Access denied for user 'username'@'com pname-345-56.abcd.edu' (using password: YES) at myscript.pl line 5
Error: Access denied for user 'username'@'com pname-345-56.abcd.edu' (using password: YES)
i would appreciate your help.
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- use DBI;
- my $dbh = DBI->connect ("DBI:mysql:mydb:myhostname:1234","username","password") or die "Error: $DBI::errstr\n";
- my $sql = "SELECT info FROM mytable limit 2";
- my $in = $dbh->prepare($sql);
- $in->execute;
- print "Content-type: text/html \n\n";
- print STDOUT "$in\n";