From the beginning. My website host is Hypermart.I am trying to install a classifieds script with MYSQL from Fuzzymonkey.com. The index.cgi uses sitevariables.pm for all paths and anything else it needs. The problem is that the script cannot find MYSQL.The scripts has the following snippit to call the MYSQL
if ($dbh = DBI->connect("dbi:mysql:$svb::mysqldb","$svb::mysqluser","$svb::mysqlpass"))
here is the error I get
[Mon May 4 07:53:12 2009] index.cgi: DBI connect('rlw.hypermartmysql.com','rlw',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /home/users/web/b1263/hy.rlw/cgi-bin/class/index.cgi line 39
Contact your webhost. That is a mysql error that could have several causes, each of which requires the webserver admin. The mysql service may not be running, or there is a conflict in its config as to where to find the mysqld.sock file.
Contact your webhost. That is a mysql error that could have several causes, each of which requires the webserver admin. The mysql service may not be running, or there is a conflict in its config as to where to find the mysqld.sock file.
have contacted them and they ran a test and said that mysql is running. Although from what I can see they used php to access it.
<?php $con = mysql_connect("rlw.hypermartmysql.com","rlw","deadly"); if (!$con) { die('Could not connect: ' . mysql_error()); } echo "Connected successfully"; ?>
even so I used the same db the same user and the same password. so it should work for me.
If you're receiving the "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' " error, but the test that your host performed didn't, then it's a permissions issue, which the webserver admin may need to correct.
Is the script running under strictures and warnings? Meaning, does it have these use statements?
Code:
use strict;
use warnings;
Does it also have this statement?
Code:
use CGI::Carp qw(fatalsToBrowser);
Can you post a more complete sample of your script and any/all warnings and errors that it produces?
If you're receiving the "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' " error, but the test that your host performed didn't, then it's a permissions issue, which the webserver admin may need to correct.
Is the script running under strictures and warnings? Meaning, does it have these use statements?
Code:
use strict;
use warnings;
Does it also have this statement?
Code:
use CGI::Carp qw(fatalsToBrowser);
Can you post a more complete sample of your script and any/all warnings and errors that it produces?
have the permissions set right for the script if that is what you mean,
also have the [code]use strict; and [CODE]use CGI::Carp qw(fatalsToBrowser);
tried to attach the index.cgi but it will not let me
#!/usr/bin/perl
use warnings;
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI;
my $cgi = new CGI;
print $cgi->header;
print $cgi->start_html('Test');
##########################
my $database = "test";
my $host = "localhost";
my $username = "u";
my $password = "p";
##########################
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
print "<b>Installed Module</b><br/>";
foreach my $module ($instmod->modules())
{
my $version = $instmod->version($module) || "???";
print "$module -- $version<br/>";
}
use DBI;
my @drivers;
@drivers = DBI->available_drivers();
print "<br/><br/><b>Here are a list of available drivers:</b><br/>";
foreach (@drivers)
{
print "$_ driver is available<br/>";
}
my $dsn = "dbi:mysql:database=$database;hostname=$host";
my %attr = (
PrintError => 0,
RaiseError => 0
);
#connect to database
my $dbh = DBI->connect($dsn, $username, $password, \%attr)
or die "Cannot connect to database: $DBI::errstr";
if($dbh)
{
print "<b>Database is fine.</b><br/>";
}
$dbh->disconnect();
print $cgi->end_html();
What about running this test on your host, make sure that you can see DBD::mysql in the install moule
#!/usr/bin/perl
use warnings;
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI;
my $cgi = new CGI;
print $cgi->header;
print $cgi->start_html('Test');
##########################
my $database = "test";
my $host = "localhost";
my $username = "u";
my $password = "p";
##########################
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
print "<b>Installed Module</b><br/>";
foreach my $module ($instmod->modules())
{
my $version = $instmod->version($module) || "???";
print "$module -- $version<br/>";
}
use DBI;
my @drivers;
@drivers = DBI->available_drivers();
print "<br/><br/><b>Here are a list of available drivers:</b><br/>";
foreach (@drivers)
{
print "$_ driver is available<br/>";
}
my $dsn = "dbi:mysql:database=$database;hostname=$host";
my %attr = (
PrintError => 0,
RaiseError => 0
);
#connect to database
my $dbh = DBI->connect($dsn, $username, $password, \%attr)
or die "Cannot connect to database: $DBI::errstr";
if($dbh)
{
print "<b>Database is fine.</b><br/>";
}
$dbh->disconnect();
print $cgi->end_html();
What about running this test on your host, make sure that you can see DBD::mysql in the install moule
that snippit worked just dandy. I used rlw and my password and it gave me a page full. Yes it has DBD::mysql .At the end it says Database is fine.
might my problem be with the way I set up my tables? I imported them from my desktop
Perl is telling that it can't find the common.pm module in any of the directories that it's configured for holding modules.
Do you have that file? If so, what is the exact path to that file?
Did the classifieds script from Fuzzymonkey.com come with a README or similar file that gives installation instructions. If so, did you follow those instructions exactly, or did you take some short cuts?
Perl is telling that it can't find the common.pm module in any of the directories that it's configured for holding modules.
Do you have that file? If so, what is the exact path to that file?
Did the classifieds script from Fuzzymonkey.com come with a README or similar file that gives installation instructions. If so, did you follow those instructions exactly, or did you take some short cuts?
When I asked about the path to common.pm, I was referring to the system path, not a web url.
What is the exact system path of index.cgi and common.pm?
If you followed the installation instructions correctly, then I'd say that there is a bug/error in those instructions. Have you contacted the author of the script? Do they provide any support for their app?