I have a problem with connected at database,no running,
MySql is runnig, tables and field is create but i do perl nameprogram.pl it say :
DBI: connect('gigi',user'...)failer:Access denied for user 'user'@'localhost'(using password:YES) at perl-bigin.pl line 6
Eroare (1045): Access denied for user 'user'@localhost'(using password:YES)
This is my program
use DBI;
$user ="gigi";
$driver = "DBI:mysql:gigi";
$dbh =DBI->connect($driver, $user) or die "\n Eroare ($DBI::err): $DBI::errstr\n";
$first = "alina";
$second = "unu";
$statement = $dbh->prepare("select $first, $second from user") or die "\n Eroare ($DBI::err):$DBI::errstr\n";
$statement->execute or die "\n Eroare ($DBI::err): $DBI::errstr\n";
print "\n \n Returnare $first si $second \n";
while(($firstname, $lastname) = $statement->fetchrow_array){
print "$alina\n $unu\n";
}
$statement->finish;
$dbh->disconnect;
Regards
Dontu,
MySql is runnig, tables and field is create but i do perl nameprogram.pl it say :
DBI: connect('gigi',user'...)failer:Access denied for user 'user'@'localhost'(using password:YES) at perl-bigin.pl line 6
Eroare (1045): Access denied for user 'user'@localhost'(using password:YES)
This is my program
use DBI;
$user ="gigi";
$driver = "DBI:mysql:gigi";
$dbh =DBI->connect($driver, $user) or die "\n Eroare ($DBI::err): $DBI::errstr\n";
$first = "alina";
$second = "unu";
$statement = $dbh->prepare("select $first, $second from user") or die "\n Eroare ($DBI::err):$DBI::errstr\n";
$statement->execute or die "\n Eroare ($DBI::err): $DBI::errstr\n";
print "\n \n Returnare $first si $second \n";
while(($firstname, $lastname) = $statement->fetchrow_array){
print "$alina\n $unu\n";
}
$statement->finish;
$dbh->disconnect;
Regards
Dontu,