Re: There are no DB defined space limits on MySQL Databases ?
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.ISDthis is the data file customer.ISMthis 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. #303Daytime 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
Re: There are no DB defined space limits on MySQL Databases ?
On Fri, Feb 16, 2001 at 10:46:40AM -0800, Fox Mulder wrote: --- Brian Reichert [EMAIL PROTECTED] wrote: On Sat, Feb 17, 2001 at 03:23:49PM +0800, yindu wrote: There are no DB defined space limits on MySQL Databases ?It's dangerours .How to control the database space on my database user? Filesystem quotas. But, to define filesystem quota, I will need to change de Owner of the file to the name of the respecive user right? Example: if the table belong to user max, I'll: chown max.users *.ISM Right?? Well, let me make sure I undertand what you mean. If _all_ of the database tables are owned by the same user (ie. the user the mysqld runs as), then you could arrange that the database tables live on their own filesystem. If the database tables have to co-exist if other files owned by other users, then yes, you'd have to employ per-user quotas. As you how your OS imposed those limits, you'd have to do research. But yes, at the very least, those database table files would have to be owned by the user you're trying to constrain. If that user is different than the UID that mysqld runs under, then you'd have to assure that mysqld has read/write access to the file. As I write this, I realize I don't know if/how quotas will be imposed when mysqld's UID write to a file owned by otheruser. I suspect that mysqld's own limits will be enforced, not otheruser's. Look into: - putting the worrisome files onto their own filesystem. - resource limits (RLIMIT_FSIZE in setrlimit(2), for example. My OS (FreeBSD) has a command-line tool [limits(1)] for contraining processes. - filesystem quotas. My OS lets me have both user and group quotas. YMMV. []'s Fox W. Mulder __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ - 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 -- Brian 'you Bastard' Reichert[EMAIL PROTECTED] 37 Crystal Ave. #303Daytime 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
Re: There are no DB defined space limits on MySQL Databases ?
On Sat, Feb 17, 2001 at 03:23:49PM +0800, yindu wrote: There are no DB defined space limits on MySQL Databases ?It's dangerours .How to control the database space on my database user? Filesystem quotas. -- Brian 'you Bastard' Reichert[EMAIL PROTECTED] 37 Crystal Ave. #303Daytime 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
Re: There are no DB defined space limits on MySQL Databases ?
--- Brian Reichert [EMAIL PROTECTED] wrote: On Sat, Feb 17, 2001 at 03:23:49PM +0800, yindu wrote: There are no DB defined space limits on MySQL Databases ?It's dangerours .How to control the database space on my database user? Filesystem quotas. But, to define filesystem quota, I will need to change de Owner of the file to the name of the respecive user right? Example: if the table belong to user max, I'll: chown max.users *.ISM Right?? []'s Fox W. Mulder __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ - 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