Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Ò»¸ö¼òµ¥µÄMysqlµÄÁªºÏ²éѯÁÐ×Ó

 
Ò»¸ömysqlµÄÁªºÏ²éѯÁÐ×Ó£¬ºÜ»ù±¾µÄ£¬²»¹ýºÜʵÓá£
ÏÈ¿´Êý¾Ý±í¡£Êý¾Ý±íclass£º
------------------------------- 
id   cname
-------------------------------
1    ÄÐ×°
2    ŮƤ¿ã
3    Å®²ÊÃÞ
-------------------------------
class±í´æ·ÅµÄÊDzúÆ·µÄ´óÀàÃû³ÆºÍÆäÐòºÅ
Êý¾Ý±íproduct£º
-------------------------------
pid   ptype   pparent
-------------------------------
1      A01      1
2      A21      1
3      B10      2
4      C11      3
5      C01      2
-------------------------------
product±í´æ·ÅµÄÊDzúÆ·Ãû³Æ£¬ºÍÆäËùÊô´óÀàµÄid£¨pparent£© 
ÏÖÔÚÒªÇóÏÔʾËùÓвúÆ·ÐòºÅ¡¢Ãû³Æ¡¢ËùÊôÀà±ð£¬ÈçÏÂÐÎʽ£º
-------------------------------
ÐòºÅ Ãû³Æ     Àà±ð
-------------------------------
1      A01      ÄÐ×°
2      A21      ÄÐ×°
3      B10      ŮƤ¿ã
4      C11      Å®²ÊÃÞ
5      C01      ŮƤ¿ã
-------------------------------
ÕâÀïÒª²éѯproduct±í£¬¸ù¾Ýpparent×Ö¶ÎÔÙ¶Á³ö¶ÔÓ¦µÄclass±íÖÐpname×ֶΡ£×ͳµÄ£¬¿ÉÒÔÓÃÁ½¸öselectÓï¾äʵÏÖ£¬µ«ÊÇmysqlÖÐÓÐÁªºÏ²éѯÓï¾ä¿ÉÒÔ¼òµ¥µÄʵÏÖ£º
select product.*, class.* from product inner join class on product.pparent=class.id where product.pid is not null
ÔÚphpÖУ¬Í¨¹ýÕâÑù²éѯ³öÀ´µÄ¼Ç¼¶¼·ÅÔÚÊý×éÀïÃæ£¬±ÈÈ磺
$myrow=mysql_fetch_array(mysql_query($sql));
ÄÇô$myrowÊý×éÖУ¬Ç°Ãæ´æ·ÅµÄÊÇproductÖеÄ×ֶΣ¬ºóÃæ´æ·ÅµÄÊÇclassµÄ×ֶΡ£


Ïà¹ØÎĵµ£º

MySQL È«ÎļìË÷ ʵÏÖÖÐÎļìË÷

ͨ¹ýMySQLÄÚÖÃÈ«ÎļìË÷ʵÏÖÖÐÎĵÄÏà¹Ø¼ìË÷
¹Ø¼ü×Ö£ºMySQL È«ÎļìË÷ È«ÎÄË÷Òý ÖÐÎÄ·Ö´Ê ¶þÔª·Ö´Ê ÇøÎ»Âë ÏàËÆ¶È
×¢£º±¾ÎÄʹÓõÄMySQL°æ±¾Îª£ºMySQL 4.0.x
ÔÚMySQL4ÖУ¬ÊÇÒѾ­¿ªÊ¼Ö§³ÖÈ«ÎļìË÷£¨Ë÷Òý£©µÄÁË¡£µ«ÊÇÖ»ÊǶÔÓ¢ÎÄÖ§³ÖÈ«ÎļìË÷¡£
ÓÉÓÚÓ¢ÎÄÔÚÊéдÉϵÄÌØÊâÐÔ£¬Ê¹µÃ·Ö´ÊËã·¨Ïà¶ÔÖÐÎÄÀ´Ëµ£¬¼òµ¥µÃ¶à¡£Ò»°ãÀ´Ëµ£¬ÎÒÃÇ ......

MySQLÐÔÄÜ¼à¿ØÐ¡ÖªÊ¶ (ת)

 ÒýÓÃhttp://hi.baidu.com/mygf/blog/item/b9f55d60049a2ed58cb10d64.html
2009-10-24 00:23
Ò»£¬»ñÈ¡mysqlÓû§ÏµĽø³Ì×ÜÊý
ps -ef | awk '{print $1}' | grep "mysql" | grep -v "grep" | wc-1
¶þ£¬Ö÷»úÐÔÄÜ״̬
# uptime
[root@ ~]# uptime
13:05:52 up 53 days, 52 min, 1 user, l ......

mysql µÄһЩ³£ÓÃÃüÁî

 ÔÊÐíËùÓÐÖ÷»úÔ¶³Ì·ÃÎÊ
GRANT ALL PRIVILEGES ON *.* TO 'dba'@'%' IDENTIFIED BY 'dbapassword' WITH GRANT OPTION;
Ö¸¶¨Ö÷»ú¿ÉÔ¶³Ì
GRANT ALL PRIVILEGES ON *.* TO 'dba'@'192.168.0.100' IDENTIFIED BY 'dbapassword' WITH GRANT OPTION;
Ö¸¶¨È¨ÏÞ¿ªÔ¶³Ì
grant select,insert,update,delete on test.* to db ......

MySQLºÍOracleµÄһЩ²Ù×÷Çø±ð

 ÓкܶàÓ¦ÓÃÏîÄ¿, ¸ÕÆð²½µÄʱºòÓÃMYSQLÊý¾Ý¿â»ù±¾ÉÏÄÜʵÏÖ¸÷ÖÖ¹¦ÄÜÐèÇó£¬Ëæ×ÅÓ¦ÓÃÓû§µÄÔö¶à£¬Êý¾ÝÁ¿µÄÔö¼Ó£¬MYSQL½¥½¥µØ³öÏÖ²»¿°ÖظºµÄÇé¿ö£ºÁ¬½ÓºÜÂýÉõÖÁå´»ú£¬ÓÚÊǾÍÓаÑÊý¾Ý´ÓMYSQLǨµ½ORACLEµÄÐèÇó£¬Ó¦ÓóÌÐòÒ²ÒªÏàÓ¦×öһЩÐ޸ġ£±¾ÈË×ܽá³öÒÔϼ¸µã×¢ÒâÊÂÏϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1£® ×Ô¶¯Ôö³¤µÄÊý¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ