Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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;


Ïà¹ØÎĵµ£º

ÀûÓÃmysqlº¯Êý¸üÐÂmemcached

Memcached Functions for MYSQL¹Ù·½Ö÷Ò³£º
https://launchpad.net/memcached-udfs
Á½Æª»ù±¾ÎÄÕ£º
http://www.libing.name/2009/02/06/mysql-map-data-to-memcached.html
http://www.libing.name/2008/02/26/mysql-map-memcached.html
°²×°ºÍÑéÖ¤µÄSQLÓï¾ä£º
http://hg.tangent.org/memcached_functions_mysql/file/7 ......

mysql¶Ô×ÔÔöidÖØÐ´Ó1ÅÅÐòµÄÁ½ÖÖ·½·¨

ʹÓÃmysqlʱ£¬Í¨³£±íÖлáÓÐÒ»¸ö×ÔÔöµÄid×ֶΣ¬µ«µ±ÎÒÃÇÏ뽫±íÖеÄÊý¾ÝÇå¿ÕÖØÐÂÌí¼ÓÊý¾Ýʱ£¬Ï£ÍûidÖØÐ´Ó1¿ªÊ¼¼ÆÊý£¬ÓÃÒÔÏÂÁ½ÖÖ·½·¨¾ù¿É£º
·½·¨Ò»£º
alter table tablename drop column id;
alter table tablename add id mediumint(8) not null primary key auto_increment first;
·½·¨¶þ£º
alter table tab ......

mysql ´´½¨±í²¢ÉèÖÃÖ÷¼ü×ÔÔö

mysql ´´½¨±í£º
mysql> create table user(
    -> userid int(4) primary key not null auto_increment,
    -> username varchar(16) not null,
    -> userpassword varchar(32) not null
    -> );
create table log(
logid int(4) ......

asp.netÁ¬½ÓmysqlµÄÎÊÌâ

Ò»£ºasp.netÔõôÁ¬½ÓmysqlÊý¾Ý¿â
   ÏÂÔØmysql connectionµÄ¶«Î÷
   http://dev.mysql.com/downloads/connector/net/6.2.html
   ÓÐ3¸ödownloadÑ¡µÚÒ»¸öÏÂÔØ
   Windows (x86, 32-bit), ZIP Archive 
   mysql-connector-net-6.2.2-noinstall.zip ......

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

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