Õâ¸öÎļþϵͳ»¹´¦ÓÚʵÏÖÖУ¬»¹²»ÊÇÕýʽ²úÆ·¡£
ÕâÊÇÒ»¿îÕýÔÚ¿ª·¢ÖÐµÄ Linux Îļþϵͳ£¬ÄÜ°Ñ Linux ÉϵÄ
MySQL Êý¾Ý¿â×÷ΪÎļþϵͳÀ´´¦Àí¡£¿ª·¢Ð¡×éÏ£ÍûÄܵõ½
¸ü¶àµÄ½¨Ò飬ÏÂÃæµÄÎÄÕ·Òë×Ô£º
http://no.spam.ee/~tonu/mysqlfs.html
ʵ¼ÊÉÏ£¬Õâ²»ÊÇͨ³£ÒâÒåÉϵÄÎļþϵͳ£¬ËüûÓдÅÅ̿ռ䣬
¶øÊÇʹÓà MySQL ÊØ»¤³ÌÐòÀ´´æ´¢Êý¾Ý¡£¿ÉÒÔ°Ñ SQL ±íºÍ
һЩº¯Êýͨ¹ýÎļþϵͳÀ´ÊµÏÖ¡£
Ò»¡¢ÔõÑùʵÏÖ£¿
ÈÃÎÒÃÇÀ´¿´Ê¹ÓÃʵÀý£º
[root@localhost /root]# mount -t corbafs -o ``cat /tmp/mysqlcorbafs.ior`` none
/mnt/mysql/
[root@localhost /root]# mount
/dev/hda3 on / type ext2 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /mnt/win type vfat (rw,mode=777)
/dev/hda4 on /mnt/linux type vfat (rw,noexec,nosuid,nodev,mode=777)
none on /mnt/mysql type corbafs
(rw,IOR:01e50d401b00000049444c3a436f72626146532f46696c6553797374656d3a312e
300000010000000000000030000000010100000a0000003132372e302e302e310008041800
0000000000009224bc335663462a01000000ef7ae13c0943c59f)
[root@localhost /root]# ls -la /mnt/mysql/
total 0
-r-xr-xr-x 1 root root 4096 dets 29 22:21 .uptime
dr-xr-xr-x 1 root root 4096 dets 29 22:21 test
dr-xr-xr-x 1 root root 4096 dets 29 22:21 mysql
[root@localhost /root]# cat /mnt/mysql/.uptime
1994
[root@localhost /root]# cat /mnt/mysql/mysql/user/Host
cpq.spam.ee
cpq.spam.ee
localhost
localhost
localhost
localhost
localhost
localhost
[root@localhost /root]# cat /mnt/mysql/mysql/user/Insert_priv
N
N
N
N
N
N
Y
Y
[root@localhost /root]# umount /mnt/mysql/
¶þ¡¢ÎªÊ²Ã´ÒªÕâÑù×öÄØ£¿
ÔÚһЩÇéÐÎÏ£¬ÕâÑù×öÄÜÈù¤×÷¸ü¼ÓÇáËÉ¡£MySQL ºÍÎļþϵͳ¶¼ÄܽÐ×öÊý¾Ý¿â£¬µ«ÊÇÓÐ
מøÈ»²»Í¬µÄ¸ÅÄîºÍÓÅȱµã¡£ÔÚÎļþϵͳÀ¶ÔÏóÄܺܿì¶øÇÒºÜÈÝÒ×ÕÒµ½£¬¼´Ê¹¸Ä±äÃû
×ÖÒ²ÄܺܿìÕÒµ½¡£Ã¿Ò»¸ö³õѧÕß´ó¸Å¶¼Ó¦¸Ãѧ»ámove/copy/rename/delete ÕâÑùµÄ²Ù×÷¡£
µ«ÊÇ SQL ²»Ò»Ñù£¬
Ëûͨ¹ýÓ¦ÓóÌÐòÀ´²Ù×Ý´æ´¢ÔÚÎļþϵͳÉϵÄÊý¾Ý¡£¶ø MySQL Îļþϵͳ°Ñ SQL ×öµ½ÁËÓû§
¼¶¡£Óû§ÄÜÓÃËûÃÇÖªµÀµÄ·½Ê½À´²Ù×÷Êý¾Ý¿â¡£
-ÈκÎÒ»¸öвúÆ·ÐèҪͨ¹ýÍøÂç´æÈ¡Êý¾ÝµÄ»°£¬±ØÐëÖ§³ÖһЩÐÒéÒÔ¼°¿ÉÄܵÄÆäËû°ì·¨Í¨
¹ýÍøÂç´æÈ¡Îļþϵͳ¡£MySQL ±í¾Í¿ÉÒÔͨ¹ýÕâÑùµÄ·½Ê½À´´æÈ¡£¬¼´Ê¹MySQL ûÓÐÒÆÖ²µ½
¶ÔÓ¦µÄƽ̨¡£
-±¸·ÝºÍ°æ±¾¿ØÖÆ£¬ÆÕͨµÄÎļþϵͳͨ¹ýÈκα¸·ÝÈí¼þ¾Í¿ÉÒÔʵÏÖ¡£Êý¾Ý¿ÉÒÔͨ¹ýdiff
À´±È½Ï²¢ÇÒÓÃcvs À´¿ØÖÆ°æ±¾¡£
-¸ü¶ÌµÄ±à³Ìʱ¼ä£¬ÓÐʱºòÈËÃÇÐèÒª±£´æ¼òµ¥µÄÊý¾Ý£¬Ïñµ±Ç°ÈÕÆÚ»òÕßÕ¾µãÃû×Ö£¬ÕâЩÊý
¾ÝºÜÉٸı䣬ÆÕͨµÄ·½·¨ÐèҪʹÓãº
Á¬½Ó·þÎñÆ÷-> Ñ¡ÔñÊý¾Ý¿â -> Ö´ÐÐÃüÁî-> ´æ´¢½á¹û
¶øʹÓà MySQL Îļþϵͳºó£¬Ö»ÐèÒªÒ»¾ä»°£º(PHPʵÏÖ)
include(¡§/mountpoint/database/table/field¡§);
»òÕߣ¬»»Ò»ÖÖ·½Ê½±í´ï£º
include(¡§/mnt/mysql/sitedata/topic/todaytopic¡§);
ÕâÑù¾ÍºÜÈÝÒ×Àí½â£¬Ò²Õ¼ÓÃÁ˽ÏÉٵĿռ䡣»¹¿ÉÒÔͨ¹ý SAMBA À´¹²Ïí /mnt/mysql£¬´ïµ½
Ö±½ÓÐÞ¸Ä SQL Êý¾Ý¿â
µÄÄ¿µÄ¡£ÄÜÖ±½ÓдÎı¾µ½Êý¾Ý¿â£¬»òÕßʹÓÿ½±´£¯Õ³Ìù¹¦ÄÜ°ÑͼƬ·ÅÈëÊý¾Ý¿â£¬ÕâÒª±ÈÓÃ
Perl »òÕß PHP д¼¸°ÙÐгÌÐòÊ¡Á¦¶àÁË¡£
Èý¡¢ÐÔÄÜÈçºÎ£¿
ÔÚ·¢±íÕâƪÎÄÕµÄʱºò£¬Õâ¸öÎļþϵͳ»¹´¦ÓÚÔÐÍ¿ª·¢½×¶Î£¬Òò´Ë£¬ËٶȻ¹²»ÊǺÜÀíÏë¡£
Èç¹ûµ½ÁËÕýʽ·¢²¼µÄʱºò£¬Ò»Ð©Êý¾Ý¿â¹¦ÄÜ»á±ÈʹÓà SQL Òª¿ì¡£ µ±È»£¬ºÜ¶à»¹ÊÇû·¨ºÍ
SQL Ïà±È£¬ÎÞÂÛÊÇÐÔÄÜÉÏ»¹Êǹ¦ÄÜÉÏ£¬ºÜ¶à¸´ÔӵIJéѯÒÀÈ»ÐèҪͨ¹ýSQL Óï¾äÀ´Íê³É¡£µ«
ÊÇ£¬ÕâÑù½ÚÊ¡Á˺ܶ࿪·¢ºÍÅàѵµÄʱ¼ä£¬ËùÒÔÔÚЧÂÊÉÏÀ´ËµÒ²ÊÇÒ»ÖÖ½ÚÊ¡¡£
ËÄ¡¢Ö§³ÖµÄ±íÀàÐÍ£º
Ä¿Ç°Õâ¸öÎļþϵͳ֧³ÖËùÓеıíÀàÐÍ£ºMyISAM£¬DBD£¬HEAP£¬ISAM¡£
Îå¡¢ÆäËûµÄÌØÉ«£º
ÔÚµÚÒ»²½¿ª·¢ÖÐʵÏֵĻ¹Ö»ÊÇÖ»¶Á£¬ºÜ¿ì»áÓÐÄܶÁдµÄ°æ±¾³öÀ´¡£Ä¿Ç°µÄ¼Æ»®ÊÇ°ÑÊý¾Ý¿â
¶ÔÏóÓ³Éä³ÉÎļþºÍĿ¼¶ÔÏó¡£ÈÃÎÒÃÇÀ´¿´¿´Àý×Ó£º
8<-
#½¨Á¢±í
CREATE TABLE invoice (
invoice_id int(10) unsigned NOT NULL auto_increment,
invoice_no int(10) unsigned DEFAULT ´´0´´ NOT NULL,
payee char(40) DEFAULT ´´´´ NOT NULL,
PRIMARY KEY (invoice_id),
KEY payee (payee)
);
# ²åÈëÊý¾Ý
INSERT INTO invoice VALUES (1,100,´´Company AB´´);
INSERT INTO invoice VALUES (2,101,´´Company CD´´);
INSERT INTO invoice VALUES (3,102,´´Company EF´´);
8<-
ÒòΪ MySQL ûÓа취ʹÓüǼºÅ£¬ËùÒÔÎÒÃDZØÐ뽨Á¢Ö÷¼ü¡£
¾ÍÓÐÁËÒÔϵÄĿ¼½á¹¹£º
/mountpoint/database/table/primary_key/field
ÕâÑù£¬Ã¿¸öÁгöÏÖÔÚ²»Í¬µÄÎļþÐÐÖ®ÖУ¬ÎļþÊ÷µÄ½á¹¹ÈçÏ£º
/mnt/mysql/mydata/invoice/1/invoice_id
/mnt/mysql/mydata/invoice/1/invoice_no
/mnt/mysql/mydata/invoice/1/payee
/mnt/mysql/mydata/invoice/2/invoice_id
/mnt/mysql/mydata/invoice/2/invoice_no
/mnt/mysql/mydata/invoice/2/payee
/mnt/mysql/mydata/invoice/3/invoice_id
/mnt/mysql/mydata/invoice/3/invoice_no
/mnt/mysql/mydata/invoice/3/payee
ÁíÍ⣬»¹Óеڶþ¸ö°ì·¨¿ÉÒÔʹÓãº
/mountpoint/database/table/.table
ºÍ
/mountpoint/database/table/primary_key/.record
/mnt/mysql/mydata/invoice/.table
/mnt/mysql/mydata/invoice/1/.record
/mnt/mysql/mydata/invoice/1/invoice_id
/mnt/mysql/mydata/invoice/1/invoice_no
/mnt/mysql/mydata/invoice/1/payee
/mnt/mysql/mydata/invoice/2/.record
/mnt/mysql/mydata/invoice/2/invoice_id
/mnt/mysql/mydata/invoice/2/invoice_no
/mnt/mysql/mydata/invoice/2/payee
/mnt/mysql/mydata/invoice/3/.record
/mnt/mysql/mydata/invoice/3/invoice_id
/mnt/mysql/mydata/invoice/3/invoice_no
/mnt/mysql/mydata/invoice/3/payee
ÕâЩÎļþÊÇÒþº¬µÄ£¬ÒÔ·ÀÖظ´£¬Ö÷ÒªÓÃÀ´·½±ãµØͨ¹ýÎı¾Îļþä¯ÀÀÆ÷À´²é¿´¡£
ÏÖÔÚ£¬ÔÚÄÇЩÐèҪʹÓà SQL Óï¾äËÑË÷×îС£¬×î´ó£¬×îºóµÈÊý¾Ý£¬¿ÉÒÔͨ¹ý·ûºÅÁ¬½ÓÀ´Êµ
ÏÖÁË£º
/mountpoint/database/table/primary_key/.max
»òÕß
/mnt/mysql/mydata/invoice/invoice_id/.max
»òÕßÖ¸Ïò
/mountpoint/database/table/field
ºÍ
/mnt/mysql/mydata/invoice/3
ͬÑùµÄ¾Í¿ÉÒÔ·µ»ØÒ»ÐÐµÄ min/max/sum/avg µÈÊýÖµ¡£
ÕâÄܺܿ첢ÇÒºÜÈÝÒ×µØʵÏÖ¡£
/mnt/mysql/mydata/.keys/
/mnt/mysql/mydata/.keys/invoice_id/
/mnt/mysql/mydata/.keys/payee/
·ûºÅÁ¬½Óµ½Ö÷¼ü£º
/mnt/mysql/mydata/.keys/.primary_key/
ʵ¼ÊÉÏÖ¸Ïò
/mnt/mysql/mydata/.keys/invoice_id/
»¹ÓÐһЩÒþ²ØÎļþÌṩ¼üÀàÐÍ£º
/mnt/mysql/mydata/.keys/invoice_id/.type
/mnt/mysql/mydata/.keys/payee/.type
µÚÒ»¸öÎÄÄÚÈÝΪ£º¡§PRIMARY KEY¡§ µÚ¶þ¸öΪ ¡§KEY¡§ ¡£
ÁíÍ⻹¿ÉÒÔÓÃË÷ÒýÀ´ÅÅÐò¼Ç¼£¬Èç¹û¶ÁÈ¡ÏÂÃæµÄĿ¼£º
/mnt/mysql/mydata/.keys/payee/asc/
PHP µÄreaddir() º¯Êý¾ÍÒÔÉýÐò·µ»ØÊý¾ÝµÄ·ûºÅÁ¬½Ó¡£
ÁíÍ⻹ÓÐһЩȫ¾Öº¯Êý£º
/mountpoint/.version
/mountpoint/.last_insert_id
/mountpoint/.uptime
/mountpoint/database/.raid (0/1)
/mountpoint/database/.type (ISAM/MyISAM/HEAP/DBD)
/mountpoint/database/.tables
/mountpoint/database/table/.created
/mountpoint/database/table/.last_updated
/mountpoint/database/table/.last_checked
/mountpoint/database/table/.count
Áù¡¢Ð´È¨ÏÞ£¿
ÔÚ¿ª·¢µÄµÚ¶þ½×¶Î£¬»áÓдëÊ©Ö´ÐÐ SQL Óï¾ä¡£ÏÖÔÚµÄ˼·ÊÇ£º
²ÉÓÃĿ¼£º
/mountpoint/database/.command/
È»ºóÖ´ÐÐÃüÁ°ÑSQL Óï¾ä×÷ΪĿ¼½¨Á¢¡£
»òÕß½¨Á¢Ä¿Â¼°ÑSQL Óï¾ä×÷ΪÎļþ·ÅÈëÕâ¸öĿ¼¡£
Á½¸ö·½°¸¶¼ÓÐÓŵ㣬µÚÒ»¸ö·½°¸¿ÉÒÔÖØÐÂʹÓà SQL Óï¾ä£¬µ«ÊÇÕâÑùµÄĿ¼ÃûʵÔÚ²»¸ÒÁî
È˹¶Í¬¡£µÚ¶þ¸ö·½°¸²ÉÓÃÐźÅÁ¿Îļþ£¬Óï¾äÖ´ÐÐÍê±Ï¾Íɾ³ýÕâ¸öÎļþ£¬Ã»ÓÐÈÎÎñʹÓÃʱ£¬
Ŀ¼Ҳ±»É¾³ý¡£¶ÔÓÚÄÇЩÂýËٵIJéѯÏìÓ¦£¬¿ÉÒÔÑ¡Ôñ timeout µÄʱ¼ä¡£
Æß¡¢È¨ÏÞ¹ÜÀí
ÔÚȨÏÞ¹ÜÀí·½Ã棬¿ÉÒÔʹÓà Unix µÄȨÏÞ¹ÜÀí·½Ê½£¬ÕâÑùµÄ·½°¸¿´À´ÊÇ×îºÃµÄ¡£
jerry520 ÓÚ 2009-03-27 16:44:04·¢±í:
ºÇºÇ,²»´í°¡!ѧϰÁË.
root ÓÚ 2005-09-17 07:35:48·¢±í:
²»´í,Ö§³Ö
yo ÓÚ 2005-09-09 00:32:03·¢±í:
ѧϰÁË
love601 ÓÚ 2005-08-20 12:03:12·¢±í:
Ҫʵ¼ù¹ý²ÅÖªµÀ°¡
aini ÓÚ 2005-08-20 00:10:01·¢±í:
¿´¿´
ming ÓÚ 2005-07-01 00:09:26·¢±í:
Ö§³Ö
chentong ÓÚ 2005-05-22 00:13:05·¢±í:
¶¥