Thank you very much. That solves my problem
-Message d'origine-
De : Dan Nelson [mailto:[EMAIL PROTECTED]
Envoyé : 13 décembre 2004 12:03
À : Duhaime Johanne
Cc : [EMAIL PROTECTED]
Objet : Re: DBI-connect does not work in crontab but works interactively
In the last episode (Dec 13
hello,
i have a shell script with 6 programs. if i run it directly as :
sh first.sh all progrms with get executd and everything works fine.
but if i give this script in crontab using
0 10 * * * /two/three/name.sh
Only progs without database connection will get executed . but database
53)
open (DBLIST, $DB_LIST); #list of all db we have
while (DBLIST) {
my $db_name=$_;
chomp($db_name);
my $dsn = DBI:mysql:$db_name:localhost; # data source name
my $dbh = DBI-connect ($dsn,$DBUSER, $DBPASS,
{ RaiseError = 1, PrintError = 0 })
or die Could
In the last episode (Dec 13), Duhaime Johanne said:
I have a script that check the status of all innodb tables. It works
fine interactively.
But not from the crontab tab.
Here is the error message and also a list of the environment variables
from the crontab
The message is about
In the last episode (Dec 13), Dan Nelson said:
In the last episode (Dec 13), Duhaime Johanne said:
I have a script that check the status of all innodb tables. It works
fine interactively.
But not from the crontab tab.
Here is the error message and also a list of the environment
a
new dbi connect and store it in the virus table (update if it's already there). Then
I disconnect that dbi call.
Continuing on, I take each entry and update the overall_stats table, based on the date
the email was received.. So if I receive 100,00 emails on 10-24-2002, then instead of
having
for records older than 2 days (ie 600,000 records).
I make a dbi connection and select all records older than 2 days. It returns the rows.
Now I step through each row with a while loop, and if the entry is a virus, i open a new dbi connect and store it in the virus table (update if it's already
24, 2002 10:32 AM
To: [EMAIL PROTECTED]
Subject: RE: DBI Connect Fails after 20,000 record inserts/updates
Do you connect/disconnect before/after every insert?
-Original Message-
From: Dallas Engelken [mailto:dallase;nmgi.com]
Sent: Thursday, October 24, 2002 9:52 AM
To: [EMAIL
Do you connect/disconnect before/after every insert?
-Original Message-
From: Dallas Engelken [mailto:dallase;nmgi.com]
Sent: Thursday, October 24, 2002 9:52 AM
To: [EMAIL PROTECTED]
Subject: DBI Connect Fails after 20,000 record inserts/updates
I am trying to parse an email log
Hi all, I am trying to connect to my mysql database with a perl script...
I can connect from commnad line both passing a password or at password prompt...
I can connect successfully with the following line in my script..
my $dbh = DBI-connect(DBI:mysql:database=mysql;host=localhost, root
I am having a problem with MySQL. I am seeking some advice on either what is wrong
or how to pursue the cause of this bug.
I am using Perl DBI to interface with MySQL and when i execute the
following statement:
$dbh = DBI-connect('DBI:mysql:database=dbmysql2', undef, undef,
{PrintError =0
I am using Perl DBI to interface with MySQL and when i execute the
following statement:
$dbh = DBI-connect('DBI:mysql:database=dbmysql2', undef, undef,
{PrintError =0}) || die $ DBI::errstr;
it causes the error:
[Fri Aug 17 09:59:50 2001] productioncontent14.pl: Access denied for user
Umm, you didn't specify a username or password...you instead passed 'undef'.
This is the connect string I use:
$dbh = DBI-connect( DBI:mysql:database=$pb_db; host=$pb_server;
port=$pb_port,
$pb_user,
$pb_password
I am having a problem with MySQL. I am seeking some advice on either what is wrong
or how to pursue the cause of this bug.
I am using Perl DBI to interface with MySQL and when i execute the
following statement:
$dbh = DBI-connect('DBI:mysql:database=dbmysql2', undef, undef,
{PrintError =0
I am having a problem with MySQL. I am seeking some advice on either what is wrong
or how to pursue the cause of this bug.
I am using Perl DBI to interface with MySQL and when i execute the
following statement:
$dbh = DBI-connect('DBI:mysql:database=dbmysql2', undef, undef,
{PrintError =0
how can I test DBI-connect ?
I'm geting this error:
Software error:
Execution of /var/www/cgi-bin/mySQL.pl aborted due to compilation errors.
Yann carlier
+351-21-4527104/5
www.inteliware.net
[EMAIL PROTECTED]
Looks like a perl script, so you can use 'or' (||) to evaluate your
'connect' string, i.e.
To stop the script if connect fails use
$dbh = DBI-connect(dbi:mysql:database:localhost,'user','password') || die
No connection to database;
To issue a warning only
$dbh = DBI-connect
in/perl -w
use strict;
use CGI qw(:standard);
use CGI::Carp;
use DBI;
CGI::use_named_parameters(1);
my ($db);
my $output = new CGI;
$db = param('test') or die("Could not find database!");
my $dbh = DBI-connect("DBI:mysql:$db:$server",root,passward );
if (not $dbh) {
p
die("Could not find database!");
my $dbh = DBI-connect("DBI:mysql:$db:$server",root,passward );
if (not $dbh) {
print header, start_html('title'="Information on $host = $db",
'BGCOLOR'='white');
print END_OF_HTML;
H1$host/h1
H2$db/h2
iii You will get errors like these if your script does not print out a header
iii before spitting out other information. It is usually best to print the
iii header in the very beginning of the script so you do not have to worry about
iii it. You dont have to wait until you are about to print out
Okay, I get it. The problem comes from the statement below,
wen $db = param('test') or die("Could not find database!");
After I revised it to "my $db = "test" or die("Could not find database!");"
I get expected result.
Thanks for your consideration.
Regards,
--Wen
[EMAIL PROTECTED]
aram('test') or die("Could not find database!");
my $dbh = DBI-connect("DBI:mysql:$db:$server",root,passward );
if (not $dbh) {
print header, start_html('title'="Information on $host = $db",
'BGCOLOR'='white');
print END_OF_HTML;
H1$host
22 matches
Mail list logo