|
RE: Problem connecting: msg#00012db.mysql.perl
Héctor, If you are using Windows you should have MySQL ODBC driver installed . Here is an example that use for via connection. my $dbh = DBI->connect("dbi:mysql:host=yourhostname:yourdatabase", "yourusername", "yourpassword ) or die "Can't connect to MySQL database: $DBI::errstr\n"; $sth = $dbh->prepare("INSERT INTO yourdatabase (col1,col2,col3) VALUES ('$a','$b','$c')"); $sth->execute(); Regards, Hung Tran -----Original Message----- From: Héctor S. Mendoza O. [mailto:hector@xxxxxxxxxxxxxxxxxxx] Sent: Tuesday, May 16, 2006 10:19 PM To: perl@xxxxxxxxxxxxxxx Subject: Problem connecting Hello everybody! I have a problem, I wrote a program in perl and I can't connect to the database, then I try connecting via mysql command and it works fine... Here is the script. $db="planos"; $host="localhost"; $userid="web"; $passwd="secret"; $connectionInfo="dbi:mysql:$db;$host"; $dbh = DBI->connect($connectionInfo,$userid,$passwd) or die print "Error connecting\n\n\n"; And I get DBI connect('planos;localhost','web',...) failed: Access denied for user 'web'@'localhost' (using password: YES) at ./planos.pl line 25 I use: mysql -u web -h localhost -p planos Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 38 to server version: 4.1.10a-Max-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> and I get in ok! Any ideas? TIA Héctor S. Mendoza Ortiz -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/perl?unsub=htran@xxxxxxx -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@xxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Problem connecting: 00012, Héctor S . Mendoza O . |
|---|---|
| Next by Date: | RE: Problem connecting: 00012, Héctor S . Mendoza O . |
| Previous by Thread: | Problem connectingi: 00012, Héctor S . Mendoza O . |
| Next by Thread: | RE: Problem connecting: 00012, Héctor S . Mendoza O . |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |