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

mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×Ö¶Î

//Ö÷¼ü
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default '0';
//ɾ³ýÁÐ
alter table t2 drop column c;
//ÖØÃüÃûÁÐ
alter table t1 change a b integer;
//¸Ä±äÁеÄÀàÐÍ
alter table t1 change b b bigint not null;
alter table infos change list list tinyint not null default '0';
//ÖØÃüÃû±í
alter table t1 rename t2;
¼ÓË÷Òý
mysql> alter table tablename change depno depno int(5) not null;
mysql> alter table tablename add index Ë÷ÒýÃû (×Ö¶ÎÃû1[£¬×Ö¶ÎÃû2 …]);
mysql> alter table tablename add index emp_name (name);
¼ÓÖ÷¹Ø¼ü×ÖµÄË÷Òý
mysql> alter table tablename add primary key(id);
¼ÓΨһÏÞÖÆÌõ¼þµÄË÷Òý
mysql> alter table tablename add unique emp_name2(cardnumber);
ɾ³ýij¸öË÷Òý
mysql>alter table tablename drop index emp_name;
ÐÞ¸Ä±í£º
Ôö¼Ó×ֶΣº
mysql> ALTER TABLE table_name ADD field_name field_type;
ÐÞ¸ÄÔ­×Ö¶ÎÃû³Æ¼°ÀàÐÍ£º
mysql> ALTER TABLE table_name CHANGE old_field_name new_field_name field_type;
ɾ³ý×ֶΣº
mysql> ALTER TABLE table_name DROP field_name;


Ïà¹ØÎĵµ£º

11 advanced MySQL questions

 

Explain MySQL architecture
. - The front layer
takes care of network connections and security authentications, the
middle layer does the SQL query parsing, and then the query is handled
off to the storage engine. A storage engine could be either a default
one supp ......

mysql±äÁ¿ÀàÐÍ

9.3. Óû§±äÁ¿
¿ÉÒÔÏÈÔÚÓû§±äÁ¿Öб£´æֵȻºóÔÚÒÔºóÒýÓÃËü£»ÕâÑù¿ÉÒÔ½«Öµ´ÓÒ»¸öÓï¾ä´«µÝµ½ÁíÒ»¸öÓï¾ä¡£Óû§±äÁ¿ÓëÁ¬½ÓÓйØ
¡£Ò²¾ÍÊÇ˵£¬Ò»¸ö¿Í»§¶Ë¶¨ÒåµÄ±äÁ¿²»Äܱ»ÆäËü¿Í»§¶Ë¿´µ½»òʹÓᣵ±¿Í»§¶ËÍ˳öʱ£¬¸Ã¿Í»§¶ËÁ¬½ÓµÄËùÓбäÁ¿½«×Ô¶¯ÊÍ·Å¡£
Óû§±äÁ¿µÄÐÎʽΪ@var_name
£¬ÆäÖбäÁ¿Ãûvar_name
¿ÉÒÔÓɵ±Ç°×Ö· ......

php¡¢MySqlÔËÐл·¾³

ÕâÀï½éÉÜÒ»¸ö¼¯³É»·¾³ XAMPP¡£
XAMPP ÊÇÒ»¸öÒ×ÓÚ°²×°ÇÒ°üº¬ MySQL¡¢PHP ºÍ Perl µÄ Apache ·¢Ðа档XAMPP µÄÈ··Ç³£ÈÝÒ×°²×°ºÍʹÓãºÖ»ÐèÏÂÔØ£¬½âѹËõ£¬Æô¶¯¼´¿É¡£
ÏÂÔصØÖ·£º
http://www.apachefriends.org/zh_cn/xampp.html
µ½Ä¿Ç°ÎªÖ¹£¬XAMPP ¹²ÓÐÒÔÏÂËÄÖÖ°æ±¾£º
£¨1£©ÊÊÓÃÓÚ Linux µÄ XAMPP
£¨2£©ÊÊÓÃÓÚ Windows µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ