From: Administrator Date: March 25 1999 11:22pm Subject: RE: CANT FIND FILE AND MYSTERY ERROR List-Archive: http://lists.mysql.com/mysql/983 Message-Id: <01BE76DB.B72ABF60@DRONE> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thimble, Thanks for the answer....though I am not mixing case. Here is the code. = Obviously it's a perl script. my $dbase =3D 'mysql'; # DATABASE = ENGINE my $comp_name =3D 'mothership.hanzo.net'; # HOSTNAME FOR = MACHINE my $db_name =3D ''badone'; # DATABASE = NAME my $user_id =3D '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 =3D &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 ) =3D @_; =20 if ( !( $dbh =3D 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 ) =3D @_; $sth =3D $handle->prepare($query); if ( !$sth->execute ) { print "Error:" . $sth->errstr . "\n"; } =20 ## IF SELECT QUERY RETURN HANDLE FOR DATA ## if ( $query =3D~ /^SELECT/ ) { return $sth; } =20 ## 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 =20 -----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