mysqlÖÐÓÃÃüÁîÐ޸ıí½á¹¹µÄ·½·¨
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec …]
alter_specification:
ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
or ADD INDEX [index_name] (index_col_name,…)
or ADD PRIMARY KEY (index_col_name,…)
or ADD UNIQUE [index_name] (index_col_name,…)
or ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}
or CHANGE [COLUMN] old_col_name create_definition
or MODIFY [COLUMN] create_definition
or DROP [COLUMN] col_name
or DROP PRIMARY KEY
or DROP INDEX index_name
or RENAME [AS] new_tbl_name
or table_options
ALTER TABLEÔÊÐíÄãÐÞ¸ÄÒ»¸öÏÖÓбíµÄ½á¹¹¡£ÀýÈ磬Äã¿ÉÒÔÔö¼Ó»òɾ³ýÁС¢´´Ôì»òÏûÈ¥Ë÷Òý¡¢¸Ä±äÏÖÓÐÁеÄÀàÐÍ¡¢»òÖØÐÂÃüÃûÁлò±í±¾Éí¡£ÄãÒ²Äܸıä±íµÄ×¢ÊͺͱíµÄÀàÐÍ¡£¼û7.7 CREATE TABLE¾ä·¨¡£
Èç¹ûÄãʹÓÃALTER TABLEÐÞ¸ÄÒ»¸öÁÐ˵Ã÷µ«ÊÇDESCRIBE tbl_nameÏÔʾÄãµÄÁв¢Ã»Óб»Ð޸ģ¬Õâ¿ÉÄÜÊÇMySQLÒòΪÔÚ7.7.1 Òþº¬µÄÁÐ˵Ã÷¸Ä±äÖÐÃèÊöµÄÔÒòÖ®Ò»¶øºöÂÔÁËÄãµÄÐ޸ġ£ÀýÈ磬Èç¹ûÄãÊÔͼ½«Ò»¸öVARCHAR¸ÄΪCHAR£¬MySQL½«ÈÔȻʹÓÃVARCHAR£¬Èç¹û±í°ü º¬ÆäËû±ä³¤µÄÁС£
ALTER TABLEͨ¹ýÖÆ×÷ÔÀ´±íµÄÒ»¸öÁÙʱ¸±±¾À´¹¤×÷¡£ÐÞ¸ÄÔÚ¸±±¾ÉÏÊ©ÐУ¬È»ºóÔÀ´µÄ±í±»É¾³ý²¢ÇÒÖØÐÂÃüÃûÒ»¸öеġ£ÕâÑù×öʹµÃËùÓеÄÐÞ¸Ä×Ô¶¯µØתÏòµ½ÐÂ±í£¬Ã» ÓÐÈκÎʧ°ÜµÄÐ޸ġ£µ±ALTER TABLEÕýÔÚÖ´ÐÐʱ£¬ÔÀ´µÄ×À¿É±»ÆäËû¿Í»§¶ÁÈ¡¡£¸üкÍдÈë±í±»ÑÓ³Ùµ½Ð±í×¼±¸ºÃÁËΪֹ¡£
ΪÁËʹÓÃALTER TABLE£¬ÄãÐèÒªÔÚ±íÉϵÄselect¡¢insert¡¢delete¡¢update¡¢createºÍdropµÄȨÏÞ¡£
IGNOREÊÇMySQL¶ÔANSI SQL92 µÄÒ»¸öÀ©³ä£¬Èç¹ûÔÚбíÖеÄΨһ¼üÉÏÓÐÖظ´£¬Ëü¿ØÖÆALTER TABLEÈçºÎ¹¤×÷¡£Èç¹ûIGNOREû±»Ö¸¶¨£¬¸±±¾±»·ÅÆú²¢ÇÒ»Ö¸´Ô×´¡£Èç¹ûIGNORE±»Ö¸¶¨£¬ÄÇô¶ÔΨһ¼üÓÐÖظ´µÄÐУ¬Ö»ÓÐʹÓõÚÒ»ÐУ»ÆäÓ౻ɾ³ý¡£
Äã¿ÉÒÔÔÚµ¥¸öALTER TABLEÓï¾äÖз¢³ö¶à¸öADD¡¢ALTER¡¢DROPºÍCHANGE×Ӿ䡣ÕâÊÇMySQL¶ÔANSI SQL92µÄÒ»¸öÀ©³ä£¬SQL92ÔÚÿ¸öALTER TABLEÓï¾äÖÐÖ»ÔÊÐíÒ»¸ö×Ӿ䡣
CHANGE col_name¡¢DROP col_nameºÍDROP INDEXÊÇMySQL¶Ô ANSI SQL92 µÄÀ©³ä¡£
MODIFYÊÇ Oracle ¶ÔALTER TABLEµÄÀ©³ä¡£
¿ÉÑ¡µÄ´ÊCOLUM
Ïà¹ØÎĵµ£º
http://blog.csdn.net/digyso888/archive/2008/12/18/3552981.aspx
MySQL°²×°µÄͼ½â5.0.28 ÊÕ²Ø
MySQL°²×°µÄͼ½â£¨×îа棩¡¡¡¡´ò¿ªÏÂÔصÄmysql°²×°Îļþmysql-5.0.27-win32.zip£¬Ë«»÷½âѹËõ£¬ÔËÐГsetup.exe”£¬³öÏÖÈçϽçÃ棺
¡¡¡¡mysql°²×°Ïòµ¼Æô¶¯£¬°´“Next”¼ÌÐø
¡¡¡¡Ñ¡Ôñ° ......
[Ô´´] MySQL Proxy ѧϰ±Ê¼Ç
×÷Õߣºheiyeluren
ʱ¼ä£º2008-1-28
²©¿Í£ºhttp://blog.csdn.net/heiyeshuwu
¡¾ ²âÊÔƽ̨ ¡¿
·þÎñÆ÷¶Ë£º
OS£ºFreeBSD 6.2
Lua£º 5.1.1
MySQL Server£º4.1.22-log
MySQL Proxy£º 0.6.0
¿Í»§¶Ë£º
OS£ºWindows XP Pro SP2
PHP£º PHP 5.2.4 (cli)
MySQL Client£º Ver 14.13 Distrib ......
Ò»¡¢±íµÄµ¼Èëµ¼³öÓï¾ä¼°Ê±¼ä×Ö·û´®²¿·Ö´¦Àíº¯Êý
µ¼³öÊý¾Ý¿âËùÓбíµÄ½á¹¹ mysqldump -uroot -proot db_name -d > d:/export_db.sql(½áβ²»Ó÷ֺÅ)
µ¼³öÊý¾Ý¿âij¸ö±íµÄ½á¹¹ mysqldump -uroot -proot db_n ......
ÆÕͨMySQLÔËÐУ¬Êý¾ÝÁ¿ºÍ·ÃÎÊÁ¿²»´óµÄ»°£¬ÊÇ×ã¹»¿ìµÄ£¬µ«Êǵ±Êý¾ÝÁ¿ºÍ·ÃÎÊÁ¿¾çÔöµÄʱºò£¬ÄÇô¾Í»áÃ÷ÏÔ·¢ÏÖMySQLºÜÂý£¬ÉõÖÁdownµô£¬ÄÇô¾ÍÒª¿¼ÂÇÓÅ»¯ÎÒÃǵÄMySQLÁË¡£
ÓÅ»¯ÎÞ·ÇÊÇ´ÓÈý¸ö½Ç¶ÈÈëÊÖ£º
µÚÒ»¸öÊÇ´ÓÓ²¼þ£¬Ôö¼ÓÓ²¼þ£¬Ôö¼Ó·þÎñÆ÷
µÚ¶þ¸ö¾ÍÊǶÔÎÒÃǵÄMySQL·þÎñÆ÷½øÐÐÓÅ»¯£¬Ôö¼Ó»º´æ´óС£¬¿ª¶à¶Ë¿Ú£¬¶Áд·Ö¿ª
µÚÈý¸ö ......
Hibernate ÅäÖÃͨ¹ýc3p0Á¬½ÓMYSQL
** ÐèÒªµÄ°ü: c3p0_versionxx.jar
** hibernate.cfg.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
&n ......