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

¹ØÓÚmysqlµÄ¾Û¼¯Ë÷Òý

·­Ò룺
InnoDB±í»á°üº¬Ò»¸ö¾Û¼¯Ë÷Òý£¨Êý¾Ý±íµÄÎïÀí´æ´¢Ë³ÐòºÍ±íµÄÂß¼­´æ´¢Ë³ÐòÒ»Ö£©
Ò»°ãÊÇ°´ÕÕÏÂÃæµÄ¹æÔòÀ´É趨¾Û¼¯Ë÷ÒýµÄ£º
1£¬¼ÙÈç±í°üº¬PRIMARY KEY£¬InnoDBʹÓÃËü×÷Ϊ¾Û¼¯Ë÷Òý
2£¬¼ÙÈç±íûÓж¨ÒåPRIMARY KEY£¬InnoDB½«µÚÒ»¸öÖ»°üº¬NOT NULLÊôÐÔÁеÄUNIQUE index×÷ΪÖ÷¼ü²¢ÇÒ½«ËüÉèÖÃΪ¾Û¼¯Ë÷Òý
3£¬Ç°Á½Õ߶¼²»Âú×ãµÄʱºò£¬mysql¾ÍÔö¼ÓÒ»¸öÒþ²ØµÄautocreament
Every InnoDB
table has a special index called
the clustered index
where the data for
the rows is stored:

If you define a PRIMARY KEY
on your
table, InnoDB
uses it as the clustered
index.

If you do not define a PRIMARY KEY
for
your table, MySQL picks the first UNIQUE
index that has only NOT NULL
columns as
the primary key and InnoDB
uses it as the
clustered index.

If the table has no PRIMARY KEY
or
suitable UNIQUE
index,
InnoDB
internally generates a hidden
clustered index on a synthetic column containing row ID
values. The rows are ordered by the ID that
InnoDB
assigns to the rows in such a
table. The row ID is a 6-byte field that increases
monotonically as new rows are inserted. Thus, the rows
ordered by the row ID are physically in insertion order.

Accessing a row through the clustered index is fast because the
row data is on the same page where the index search leads. If a
table is large, the clustered index architecture often saves a
disk I/O operation when compared to storage organizations that
store row data using a different page from the index record.
(For example, MyISAM
uses one file for data
rows and another for index records.)

In InnoDB
, the records in nonclustered
indexes (also called secondary indexes) contain the primary ke


Ïà¹ØÎĵµ£º

mysqlÊý¾Ý¿â·¶Ê½Ïê½â

ÔÚÉè¼Æ¹ØϵÊý¾Ý¿âʱÊÇÒª×ñÊØÒ»¶¨µÄ¹æÔòµÄ¡£ÓÈÆäÊÇÊý¾Ý¿âÉè¼Æ·¶Ê½ÏÖ¼òµ¥½éÉÜ1NF£¨µÚÒ»·¶Ê½£©£¬2NF£¨µÚ¶þ·¶Ê½£©£¬3NF£¨µÚÈý·¶Ê½£©ºÍBCNF£¬ÁíÓеÚËÄ·¶Ê½ºÍµÚÎ巶ʽÁôµ½ÒÔºóÔÙ½éÉÜ¡£ÔÚÄãÉè¼ÆÊý¾Ý¿â֮ʱ£¬ÈôÄÜ·ûºÏÕ⼸¸ö·¶Ê½£¬Äã¾ÍÊÇÊý¾Ý¿âÉè¼ÆµÄ¸ßÊÖ¡£
µÚÒ»·¶Ê½£¨1NF£©£ºÔÚ¹ØϵģʽRÖеÄÿһ¸ö¾ßÌå¹ØϵrÖУ¬Èç¹ûÿ¸öÊôÐÔÖµ¶¼Ê ......

MySQLµÄdatetimeÉèÖõ±Ç°Ê±¼äΪĬÈÏÖµ


MySQLµÄdatetimeÉèÖõ±Ç°Ê±¼äΪĬÈÏÖµ 
ÓÉÓÚMySQLÄ¿Ç°×ֶεÄĬÈÏÖµ²»Ö§³Öº¯Êý£¬ËùÒÔÓÃ
create_time datetime default now()
µÄÐÎʽÉèÖÃĬÈÏÖµÊDz»¿ÉÄܵġ£
´úÌæµÄ·½°¸ÊÇʹÓÃTIMESTAMPÀàÐÍ´úÌæDATETIMEÀàÐÍ¡£
CURRENT_TIMESTAMP £ºµ±ÎÒ¸üÐÂÕâÌõ¼Ç¼µÄʱºò£¬ÕâÌõ¼Ç¼µÄÕâ¸ö×ֶβ»»á¸Ä±ä
¡£
CURRENT_TIMESTAMP O ......

C#Á¬½ÓMySQL½øÐвÙ×÷µÄ·½·¨

ÓÉÓÚÐèҪʵÏÖÒÔϹ¦ÄÜ£º
Íø¹Øͨ¹ý´®¿Ú·¢ËÍÊý¾Ý¸øPC»ú£¬PC»úÊÕ¼¯Êý¾Ý²¢½âÎö±£´æµ½MySQLÖУ¬È»ºóJSPÒ³Ãæ¶ÁÈ¡MySQLÖеÄÊý¾Ý²¢ÏÔʾ¡£
ËùÒÔÀûÓÃC#Á¬½ÓMySQLÊý¾Ý³ÉΪÁ˱ØÐëÒª¾­¹ýµÄ¹ý³Ì£¬Ôڴ˸øÓèÏêϸµÄ˵Ã÷¡£
1¡¢ÏÂÔØÐèÒªµÄÎļþMySQLDriverCS£¬ÏÂÔصØַΪ£ºhttp://sourceforge.net/projects/mysqldrivercs
2¡¢°²×°Îļþ£ºMySQ ......

MySQLÊÂÎñ´¦Àí

START TRANSACTION, COMMITºÍROLLBACKÓï·¨
START TRANSACTION | BEGIN [WORK]
COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
SET AUTOCOMMIT = {0 | 1}
START
TRANSACTION»òBEGINÓï¾ä¿ÉÒÔ¿ªÊ¼Ò»ÏîеÄÊÂÎñ¡£COMMIT¿ÉÒÔÌá½»µ±Ç°ÊÂÎñ£¬ÊDZä¸ü³ÉΪÓÀ¾Ã±ä¸ü¡£ROLLBACK ......

MYSQLÓû§È¨ÏÞ¹ÜÀí(Grant,Revoke)

MySQL¿ÉÒÔΪ²»Í¬µÄÓû§·ÖÅäÑϸñµÄ¡¢¸´ÔÓµÄȨÏÞ¡£ÕâЩ²Ù×÷´ó¶à¶¼¿ÉÒÔÓÃSQLÖ¸ÁîGrant£¨·ÖÅäȨÏÞ£©ºÍRevoke£¨»ØÊÕȨÏÞ£©À´ÊµÏÖ¡£ Grant¿ÉÒÔ°ÑÖ¸¶¨µÄȨÏÞ·ÖÅä¸øÌض¨µÄÓû§£¬Èç¹ûÕâ¸öÓû§²»´æÔÚ£¬Ôò»á´´½¨Ò»¸öÓû§¡£
 Grant ³£Óøñʽ:
grant ȨÏÞ1,ȨÏÞ2,…ȨÏÞn on Êý¾Ý¿âÃû³Æ.±íÃû³Æ to Óû§Ãû@Óû§µØÖ· ide ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ