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

mysqlÍâ¼üµÄʹÓÃ

ÏñMySQLÕâÑùµÄ¹ØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ£¬ËüÃǵĻù´¡ÊÇÔÚÊý¾Ý¿âµÄ±íÖ®¼ä´´½¨¹ØϵµÄÄÜÁ¦¡£Í¨¹ý·½±ãµØÔÚ²»Í¬±íÖн¨Á¢¼Ç¼µ½¼Ç¼µÄÁªÏµ£¬RDBMS¿ÉÒÔÀûÓò»Í¬µÄ·½·¨·ÖÎöÊý¾Ý£¬Í¬Ê±±£³ÖÊý¾Ý¿âÒÔϵͳµÄ·½Ê½¡¢×îСµÄÈßÓà½øÐÐ×éÖ¯¡£
¼òµ¥ÃèÊö£º
ÕâЩ¹Øϵ»ù±¾ÉÏÒÀ¿¿Íâ¼ü½øÐйÜÀí£¬ÔÚ¹ØϵÖÐËùÓбíÖоßÓÐÏàͬº¬ÒåµÄ×Ö¶Î×÷Ϊ¹«¹²²¿·ÖÀ´Á¬½Ó²»Í¬±íÖеļǼ¡£Íâ¼ü¿ÉÒÔÊÇÒ»¶ÔÒ»µÄ£¬Ò»¸ö±íµÄ¼Ç¼ֻÄÜÓëÁíÒ»¸ö±íµÄÒ»Ìõ¼Ç¼Á¬½Ó£¬»òÕßÊÇÒ»¶Ô¶àµÄ£¬Ò»¸ö±íµÄ¼Ç¼ÓëÁíÒ»¸ö±íµÄ¶àÌõ¼Ç¼Á¬½Ó¡£
MySQLÖГ¼ü”ºÍ“Ë÷Òý”µÄ¶¨ÒåÏàͬ£¬ ËùÒÔÍâ¼üºÍÖ÷¼üÒ»ÑùÒ²ÊÇË÷ÒýµÄÒ»ÖÖ¡£²»Í¬µÄÊÇMySQL»á×Ô¶¯ÎªËùÓбíµÄÖ÷¼ü½øÐÐË÷Òý£¬µ«ÊÇÍâ¼ü×ֶαØÐëÓÉÓû§½øÐÐÃ÷È·µÄË÷Òý¡£ÕâºÍһЩ·â½¨Ë¼Ïë±È½Ï³ÁÖصļÒÍ¥ÊÇÒ»ÑùµÄ£¬ÍâÀ´µÄº¢×Ó(¶ùϱ¸¾£¬µ¹²åÃÅÅ®Ðö)Ò»°ã¶¼ÊDz»ÊÜÖØÊӵġ£
µÍË×ʾÀý£º
±í¼äÒ»¶ÔÒ»¹ØϵʾÀý£º
ÓÐÁ½ÕÅ±í£¬µÚÒ»ÕűíÊǼǼ¹«Ë¾ÓжàÉÙÈË£¬¶¼ÓÐË­£¬Ò²¾ÍÊÇÔ±¹¤±àºÅ¼°Ô±¹¤ÐÕÃûÕâЩ»ù±¾±í¡£ÁíÒ»Õűí¼Ç¼ÿ¸öÔ·¢¸øÓû§¶àÉÙ¹¤×Ê£¬Ëùν¹¤×ʱíÊÇÒ²¡£
µ«Êǹ¤×ʱíÀïÃæ²»ÄÜÒÔÔ±¹¤ÐÕÃûΪÖ÷¼ü£¬Í¬ÑùҪͨ¹ýÔ±¹¤id£¬ÒòΪԱ¹¤µÄÐÕÃûÊÇ¿ÉÄÜÖظ´µÄ°¡¡£²¿Ãž­Àí½ÐÕÅÈý£¬Ð¡µÜÒ²½ÐÕÅÈý£¬ÄÇÕâÁ©ÕÅÈýµÄ¹¤×ÊÄÜÒ»ÑùÂ𣿲¢ÇÒÔ±¹¤±íÀïÃæµÄÿ¸öÈ˶¼Óй¤×Ê£¬·ñÔòË­Ò²²»¸øÄã¸É»î£¬ÇÒÒ»¸öÈËÖ»ÄÜÓÐÒ»·Ý¹¤×Ê£¬·ñÔòÀÏ°åÒ²²»Í¬ÒâÁË¡£ËùÒÔÔ±¹¤±íºÍ¹¤×ʱíÊÇͨ¹ýÔ±¹¤id½øÐйØÁªµÄÒ»¶ÔÒ»¹Øϵ¡£
²»¹ýÎÒÃÇÒªÓÐÒ»¸öºÃµÄ¼ÛÖµ¹Û£¬ÎÒÃÇÉϰ಻ÄÜΪÁËÇ®£¬ÎÒÃÇÊÇΪÁËѧ֪ʶ£¬Ñ§ÎÄ»¯£¬ÎªÔçÈÕʵÏÖËĸöÏÖ´ú»¯(±ðÎÊÎÒÊÇɶ£¬Ò²±ðÎÊÎÒµ½µ×ʵÏÖûÓÐ)¶øŬÁ¦·Ü¶·¡£ËùÒÔÔÚ¹¤×ʱíÀïÈç¹ûûÓÐÄãÒ²²»ÒªÂÒº°¡£àÅ¡£
/*
½¨Á¢Ô±¹¤±í
*/
create table employees (
id int(5) not null auto_increment ,
name varchar(8) not null,
primary key (id)
)
type£½innodb;
/*
½¨Á¢¹¤×ʱí
*/
create table payroll(
id int(5) not null,
emp_id int(5) not null,
name varchar(8) not null,
payroll float(4,2) not null,
primary key(id),
index emp_id (emp_id),
foreign key (emp_id) references employees (id)
)
type = innodb;
±í¼äÒ»¶Ô¶à¹ØϵʾÀý£º
ÓÐÁ½¸ö±í£¬Ò»¸öÊÇÌ°¹Ù±í£¬ÓÐÌ°¹ÙµÄidºÍÃû×Ö¡£ÁíÓÐÒ»ÕÅÌ°¹ÙÇ鸾±í£¬×¢ÒâÒ»¸öÌ°¹Ù²»Ò»¶¨Ö»ÓÐÒ»¸öÇ鸾£¬ÆäÓиö¶þÈýËÄÎåÄÌÊǺÜÕý³£µÄ£¬ËùÒÔÔÚÌ°¹Ù±íÀïÃæµÄÒ»ÌõÊý¾Ý£¬¶ÔÓ¦Ç鸾±íÀï¿ÉÄܾÍÓжàÌõ¼Ç¼£¬ÕâÊÇͨ¹ýÌ°¹Ùid½øÐйØÁªµÄÒ»¶Ô¶à¹Øϵ¡£
²ÎÕÕÍêÕûÐÔ


Ïà¹ØÎĵµ£º

Mysql½ø»¯ÂÛ1

1.Ëü¿ÉÒÔ±»·ÖΪÈýÀࣺÊý×ÖÀàÐÍÈÕÆÚÀàºÍʱ¼äÀàÐÍ£¬×Ö·û´®ÀàÐÍ¡£
ÁÐÀàÐÍÓÃÓÚÃèÊö:
M£ºÖ¸³ö×î´óµÄÏÔʾ³ß´ç¡£×î´óµÄºÏ·¨ÏÔʾ³ß´çΪ255.
D£ºÊÊÓÃÓÚ¸¡µãÀàÐͲ¢Ö®³õ¸úËæÔÚÊ®½øÖÆСÊýµãºóµÄÊýÂëµÄÊýÁ¿¡£×î´óµÄ¿ÉÄÜÖµÊÇ30£¬µ«ÊDz»Ó¦´óÓÚM.
2.·½À¨ºÅ("[","]")Ö¸³ö¿ÉÑ¡µÄÀàÐÍÐÞÊηûµÄ²¿·Ö£®
£ªÈôÖ¸¶¨ÁËÁÐÀàÐÍΪZEROFILL,MYSQL½«¸Ã ......

ʹÓà MySQL Workbench ¿ÉÊÓ»¯µÄÉè¼Æ MySQL Êý¾Ý¿â

MySQL Workbench ÊÇ MySQL ×î½üÊͷŵĿÉÊÓÊý¾Ý¿âÉè¼Æ¹¤¾ß¡£Õâ¸ö¹¤¾ßÊÇÉè¼Æ MySQL Êý¾Ý¿âµÄרÓù¤¾ß¡£
ÄãÔÚ MySQL Workbench Öн¨Á¢µÄ±»³Æ֮ΪÎïÀíÊý¾ÝÄ£ÐÍ¡£Ò»¸öÎïÀíÊý¾ÝÄ£ÐÍÊÇÕë¶ÔÒ»¸öÌض¨ RDBMS ²úÆ·µÄÊý¾ÝÄ£ÐÍ£»±¾ÎÄÖеÄÄ£Ðͽ«¾ßÓÐһЩ MySQL µÄ¶ÀÌع淶¡£ÎÒÃÇ¿ÉÒÔʹÓÃËüÉú³É£¨forward-engineer£©Êý¾Ý¿â¶ÔÏ󣬳ýÁË°üº¬± ......

mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ

À´Ô´£ºhttp://www.blogjava.net/Alpha/archive/2007/07/23/131912.html 
//Ö÷¼ü549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ549830479
alter table t2 add d timestamp;
alter table infos add ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ