List:General Discussion« Previous MessageNext Message »
From:Administrator Date:March 25 1999 11:22pm
Subject:RE: CANT FIND FILE AND MYSTERY ERROR
View as plain text  
Thimble,

Thanks for the answer....though I am not mixing case.  Here is the code.  Obviously it's a
perl script.

my $dbase        		= 'mysql';                             	# DATABASE ENGINE
my $comp_name    	= 'mothership.hanzo.net';            # HOSTNAME FOR MACHINE
my $db_name      	= ''badone';                             	# DATABASE NAME
my $user_id      		= 'baddude';

* There is no password so I don't pass off the password to the connect script.  As you
said it connects fine.

## Connect to Database ##
my $dbase_handle = &dbase_connect ( $dbase, $db_name, $comp_name, $user_id );

* I suppose this is where the problem begins.

## INSERT INFO INTO XTREME DATABASE ##
&dbase_query ( $dbase_handle, "INSERT INTO badone ( name, email, remote_address,
message ) VALUES ( \"$name\", \"$email\", \"$remote_addr\", \"$message\" )" );

Here is the sub routine to connect to the database:

########################
## DATABASE CONNECTOR ##
########################
sub dbase_connect {
  my $dbh;
  my ( $dbase_type, $dbase_name, $hostname, $userid ) = @_;
  
  if ( !( $dbh = DBI->connect("DBI:$dbase_type:test:$hostname", $userid, undef ) ) ) {
    print "Could not attach to database: $DBI::errstr";
    exit ( 0 );
  } else {
    return $dbh;
  }
}

* Here is the sub routine to query the database:

####################
## DATABASE QUERY ##
####################
sub dbase_query {
  my ( $handle, $query ) = @_;

  $sth = $handle->prepare($query);
  if ( !$sth->execute ) { print "Error:" . $sth->errstr . "\n"; }
    
## IF SELECT QUERY RETURN HANDLE FOR DATA ##
  if ( $query =~ /^SELECT/ ) {
    return $sth;
  }
 
## CLOSE DATABASE QUERY ##
  $sth->finish;
}

The thing about all this is....that if I create the email_info table inside of the test
database and change the $db_name variable to equal test it works fine.

Database Info:

Database: badone
+------------+
|   Tables   |
+------------+
| email_info |
+------------+

Database: badone  Table: email_info  Rows: 0
+----------------+---------------+------+-----+---------+-------+
| Field          | Type          | Null | Key | Default | Extra |
+----------------+---------------+------+-----+---------+-------+
| name           | varchar(50)   | YES  |     |         |       |
| email          | varchar(50)   | YES  |     |         |       |
| remote_address | varchar(50)   | YES  |     |         |       |
| message        | blob          | YES  |     |         |       |
| submit_date    | timestamp(14) | YES  |     |         |       |
+----------------+---------------+------+-----+---------+-------+

Thanks in advance.

BD
 
-----Original Message-----
From:	Thimble Smith [SMTP:tim@stripped]
Sent:	Thursday, March 25, 1999 3:39 PM
To:	Administrator; 'mysql@stripped'
Subject:	Re: CANT FIND FILE AND MYSTERY ERROR

On Thu, Mar 25, 1999 at 03:29:17PM -0700, Administrator wrote:
> 1.	The first issue is that whenever I create a database
> using mysqladmin it gives the database permissions of 700 ie:

Yes, that's normal.

> 2.	The second I have created a second database "badone" and
> want that to be accessible to a user called baddude.  Only
> everytime that I try to connect via DBI call with a perl script
> from the web it gives me the error that the file doesn't exist:
> Error:Can't find file: 'email_info.frm' (errno: 2)

This error *typically* happens because you're mixing upper- and
lower-case.  Tables are stored as files in MySQL; if your file
system is case-sensitive (like yours), then MySQL table names
are case-sensitive.  Can you make sure that you're using the
exact same case for your CREATE TABLE xxx and your other SQL
statements?

If this isn't the problem, please give a more consistent description
of the problem.  Your problem isn't with access permissions (you're
accessing the database fine).  Please show us the exact SQL code
that is breaking and the exact info about the database.

Thanks,

Tim

Thread
CANT FIND FILE AND MYSTERY ERRORAdministrator26 Mar
  • Re: CANT FIND FILE AND MYSTERY ERRORThimble Smith26 Mar
RE: CANT FIND FILE AND MYSTERY ERRORAdministrator26 Mar
  • Re: CANT FIND FILE AND MYSTERY ERRORThimble Smith26 Mar