MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Jeremy Zawodny Date:June 5 2001 6:23pm
Subject:Re: finding the path and filenames for a table
View as plain text  
On Mon, Jun 04, 2001 at 11:51:23AM -0700, DAVE THOMAS wrote:
> 
> I am trying to create a file in the directory that the .frm, .MYI,
> and .MYD files are located for a particular table. I can create the
> file by hard-coding the path and specifying a filename but I need to
> be able to create the file in the folder of the database the table
> belongs to. How do I get the path that the database files are
> located? and the database name?

This really isn't an internals question.

But you should use the `datadir' variable from SHOW VARIABLES and
build the path from there.

  datadir/<db_name>/<table_name>.frm

And so on...

Jeremy
-- 
Jeremy D. Zawodny, <jzawodn@stripped>
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878    Fax: (408) 349-5454    Cell: (408) 439-9951

MySQL 3.23.29: up 11 days, processed 68,085,459 queries (71/sec. avg)
Thread
finding the path and filenames for a tableDAVE THOMAS5 Jun
  • Re: finding the path and filenames for a tableJeremy Zawodny5 Jun
  • Re: finding the path and filenames for a tableTimothy Smith5 Jun
  • finding the path and filenames for a tableMichael Widenius5 Jun