At 19:46 -0500 3/1/03, Bernardo Zuniga wrote:
>Hello,
>
>I'm a bit confused about where the database is located in Mac OS X.
>I was following the instructions in O'Reilly's boot using and
>Managing MySQL ad got to the point where I tried to do a select and
>output to a file. The command I ran was as follows:
>
>SELECT * INTO OUTFILE 'books.dat'
>FIELDS TERMINATED BY ','
>FROM BOOK;
>
>The book states that a test.dat file will exist n my drive at
>/usr/local/var/test/test.dat , yet no such file can be found. I
>don't even have that directory. My directory structure goes as far
>as /usr/local/ - then there is mysql-2.23.55 and an alias (mysql)
>that points to that directory. Inside mysql-2.23.55, i have a tests
>directory and a data directory which i cannot get into at the
>moment. So is the book wrong, or is it different for OS X now.
The file will be written in the database directory for the default database,
given a statement as you've written it. That will be the file
/usr/local/var/test/books.dat (not test.dat) if the current database
is test and if the server's data directory is /usr/local/var/. On
Mac OS X, it's probably not. To find out where the database directory
actually is, go into mysql and issue this query:
SHOW VARIABLES LIKE 'datadir';
That will show you a pathname. Your file will be in test/books.dat
under that.
>
>Any help is appreciated,
>Thanks,
>Bernardo Zuniga