Without looking at your code, I'd just guess your connection information is
not set right. Here's as example of how to connect to a MySQL database on
the local machine named intra_data using the "sa" user account with a
password of "sa". Edit as necessary. After you connect, you should be able
to prepare, and run your queries.



 use DBI;
  my $database_name     = "intra_data";
  my $location          = "localhost";
  my $port_num          = "3306"; # This is default for mysql


  # define the location of the sql server.
  my $database          = "DBI:mysql:$database_name:$location:$port_num";
  my $db_user           = "sa";
  my $db_password       = "sa";

  # connect to the sql server.
  my $dbh       = DBI->connect($database,$db_user,$db_password);


Have fun,

Steve Howard

-----Original Message-----
From: Glenn Emery [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 24, 2001 8:22 PM
To: [EMAIL PROTECTED]
Subject: Newbie Trying to fix


Good Day,

Please understand I am very new to this..................

I have recieved some perl scripts that hook to a Mysql database.

I was using "use DBI;" but ended up changing to "use Mysql;" after getting
numerous errors that stated "DBI->connect(supermall) failed: Access denied
for user: '@localhost' to database 'supermall' at
/var/www/cgi-bin/supermall/admin/add.cgi line 61
Couldn't connect to database!".
I am now able to hook to the database but after changing to "use Mysql" I
now get errors that state "Mysql::prepare: Not defined in Mysql and not
autoloadable (last try prepare) at /var/www/cgi-bin/supermall/admin/add.cgi
line 337" , is there something I can do about "prepare"?

Thank You!

Glenn


Reply via email to