MySQL Forums
Forum List  »  Perl

please help me to configure a script that installs tables in mysql for a domain?
Posted by: Jerry Alex
Date: July 04, 2008 05:25PM

Hi,

I just started learning PERL and CGI scripting and am a complete newbie. So I sincerely apologize if my problem seems too simple for the guru's.

its been atleast two weeks that I've been trying to install a custom script on my server. The script named install_mysql.cgi - installs a set of mysql tables into the mysql server for the domain name.

The install_msql.cgi -> calls an admin-list.inc file which in turns calls the config file containing the info for mysql, such as dbname, user, password, and host and the iSubs.pm (module) file that aides in the building of the mysql tables.

The problem that I'm facing is rather strange: When I run the install_mysql.cgi from the browser, I get a message saying "The MySQL Database has been setup properly".

But when i refer to my server error log I get the following error messages:

[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::st execute failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 188.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 220.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::st execute failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 188.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 220.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_advertisers' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_books' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_members' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_messages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_messages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_messages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::db do failed: Invalid default value for 'id' at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 182.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::st execute failed: Table 'myfunlotto.lotto_pages' doesn't exist at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 188.
[Fri Jul 04 13:19:27 2008] [error] [client 68.84.40.48] [Fri Jul 4 13:19:27 2008] install_mysql.cgi: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /var/www/vhosts/myfunlotto.com/httpdocs/lotto/data_files/iSubs.pm line 220.

---------------------------------------

iSubs.pm file:

sub OpenMySQL {
use DBI;
$dbh = DBI->connect("DBI:mysql:$mysql_db:$mysql_host",$mysql_u,$mysql_p) or die $DBI::errstr;
$mysqlopen = 1;
return; }

sub CloseMySQL {
$dbh->disconnect();
$mysqlclosed = 1;
return; }

sub DoMySQL {
if (!$mysqlopen) { &OpenMySQL; }
$dbh->do("$_[0]");
return; }

sub PrepareMySQL {
if (!$mysqlopen) { &OpenMySQL; }
$result = $dbh->prepare("$_[0]");
$result->execute();
return; }

I spent a lot of time researching on the web and the books but I just could not find a solution.

I would really appreciate your expert advice and help on how to resolve this error.

Thanks a lot guys!

Best Wishes,
genX_000!

Options: ReplyQuote


Subject
Written By
Posted
please help me to configure a script that installs tables in mysql for a domain?
July 04, 2008 05:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.