On Tue, Feb 20, 2001 at 09:33:40AM +0800, yindu wrote:
> thank you.
> i know mysql stored its tables in files,And i have looked through the mysql
>handbook.But i hadn't found information about the file systerm of mysql,i think a
>table
> is a file,then all tables in the same database should be stored in the same
>file_content.But where can i find them?
I'm assuming you've installed MySQL under some kind of UNIX. If
so:
MySQL does not have it's own 'filesystem'; it stores everything in
several large files in the UNIX filesystem.
MySQL (by default) keeps it's databases in /usr/local/var. This
is the 'datadir' parameter to the server. You can see what yours
is set to:
% echo 'show variables' | mysql
This will dump out a list of all of the configuration variables
your server is using. Look for 'datadir'.
Within that directory, there will be several sub-directories (yours
will be different than mine):
% ls -l /usr/local/var
drwx------ 2 root wheel 512 Apr 26 2000 customers
drwx------ 2 root wheel 512 Apr 26 2000 mysql
drwx------ 2 root wheel 512 Apr 26 2000 test
Each one of these is a database. My MySQL server has three databases,
'customer', 'mysql' and 'test'.
'mysql' is the database that the server itself uses to keep track
of valid users, permissions, and the like.
'customer' is one I use for a project. That directory contains several
files:
% ls /usr/local/val/customer
customer.ISD
customer.ISM
customer.frm
site.ISD
site.ISM
site.frm
My database 'customer' has two tables: 'customer' and 'site'.
MySQL stores the information about any one table in three files.
For example, my customer table has three files:
customer.ISD this is the data file
customer.ISM this is the index file
customer.frm (I forget what this is, sorry)
> Where can i find local informations?
I don't know what you mean; sorry. :/
> now i create a database named yd for my database user.If i want to know how much
>space have been used,what can i do ?
The 'space used' by a database is the amount of diskspace taken up
by the subdirectory, including all of its files. One way is with
the 'du' command:
% du -k /usr/local/var/customers
20843
The '-k' flag means "count in 1024 byte blocks". Therefore, I'm
using
20843 * 1024 = 21343232 bytes. (About two megabytes.)
Hope this helps...
--
Brian 'you Bastard' Reichert <[EMAIL PROTECTED]>
37 Crystal Ave. #303 Daytime number: (603) 434-6842
Derry NH 03038-1713 USA Intel architecture: the left-hand path
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php