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

MySqlµÄ¼òµ¥Ð޸ıí×Ö¶ÎSQLÓï¾ä

#ÐÂÔöÒ»¸ö×ֶΣ¬Ä¬ÈÏֵΪ0£¬·Ç¿Õ£¬×Ô¶¯Ôö³¤£¬Ö÷¼ü
   alter table tabelname add new_field_name field_type default 0 not null auto_increment ,add primary key (new_field_name);
#Ôö¼ÓÒ»¸öÐÂ×Ö¶Î
   alter table tableName add new_field_name field_type;
   alter table tableName add new_field_name field_type not null default '0';
#ɾ³ý×Ö¶Î
   alter table tableName drop column field_name;
#ÖØÃüÃû×Ö¶Î
   alter table tableName change old_field_name new_field_name new_field_type;
#¸Ä±ä×ֶεÄÀàÐÍ
   alter table tableName change field_name field_name field_type;
#ÖØÃüÃû±í
   alter table table_old_name rename table_new_name;
#¼ÓË÷Òý
  alter table tablename add index Ë÷ÒýÃû (×Ö¶ÎÃû1[£¬×Ö¶ÎÃû2 …]);
  alter table tablename add index index_name(name);
#ÉèÖÃÖ÷¼ü
  alter table tablename add primary key(field_name);
#Ìí¼ÓΨһË÷Òý
  alter table tablename add unique index_name(field_name);
#ɾ³ýË÷Òý
  alter table tablename drop index index_name;


Ïà¹ØÎĵµ£º

SQL²Ù×÷È«¼¯

ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓᣠ  
 
SQL·ÖÀࣺ   
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)   
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)   
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£ ......

MysqlÓû§Ìí¼Ó¼°È¨ÏÞ·ÖÅä

     ¸ñʽ£ºgrant [PRIVILEGES]  on [databaseName.tableName] to [userName]@[host] identified by [password] with grant option;
     eg1:  grant select on mysql.user to wqh@localhost
     eg2:GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ......

ÓÅ»¯MySQLÊý¾Ý¿âÐÔÄܵļ¸¸öºÃ·½·¨

1¡¢Ñ¡È¡×îÊÊÓõÄ×Ö¶ÎÊôÐÔ
¡¡¡¡MySQL¿ÉÒԺܺõÄÖ§³Ö´óÊý¾ÝÁ¿µÄ´æÈ¡£¬µ«ÊÇÒ»°ã˵À´£¬Êý¾Ý¿âÖеıíԽС£¬ÔÚËüÉÏÃæÖ´ÐеIJéѯҲ¾Í»áÔ½¿ì¡£Òò´Ë£¬ÔÚ´´½¨±íµÄʱºò£¬ÎªÁË»ñµÃ¸üºÃµÄÐÔÄÜ£¬ÎÒÃÇ¿ÉÒÔ½«±íÖÐ×ֶεĿí¶ÈÉèµÃ¾¡¿ÉÄÜС¡£ÀýÈ磬ÔÚ¶¨ÒåÓÊÕþ±àÂëÕâ¸ö×Ö¶Îʱ£¬Èç¹û½«ÆäÉèÖÃΪCHAR(255),ÏÔÈ»¸øÊý¾Ý¿âÔö¼ÓÁ˲»±ØÒªµÄ¿Õ¼ä£¬ÉõÖÁÊ ......

¸ßÐÔÄÜMYSQL¶ÁÊé±Ê¼Ç£ºMYSQL×¼±¸Óï¾ä

MYSQL4.1¼°¸ü¸ß°æ±¾Ö§³Ö·þÎñÆ÷¶Ë×¼±¸Óï¾ä(Prepared Statements), ËüʹÓÃÔöÇ¿µÄ¶þ½øÖÆ¿Í»§¶Ë/·þÎñÆ÷ЭÒéÔÚ¿Í»§¶ËºÍ·þÎñÆ÷Ö®¼ä¸ßЧµÄ·¢ËÍÊý¾Ý£¬¿ÉÒÔͨ¹ýÖ§³ÖÕâÖÖÐÐЭÒéµÄ±à³Ì¿âÀ´·ÃÎÊ×¼±¸Óï¾ä£¬ÁÐÈëMYSQL CAPI,MYSQL Connector/JºÍMYSQL Connector/NET ΪJAVAºÍ.NETÌṩÁËͬÑùµÄ·ÃÎʽӿڡ£ËüÒ²ÓÐSQLÓïÑԵķÃÎʽӿڡ£
´´½¨×¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ