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

mysql Ð޸ıí½á¹¹

1. mysql Ð޸ıíÃû×Ö
    ALTER TABLE t1 RENAME t2;
2. ÐÞ¸ÄÁеÄÃû×Ö
    >ALTER TABLE stock CHANGE COLUMN stock_id id INT(6);
3. Ôö¼ÓÁÐ
    >ALTER TABLE ab ADD COLUMN id INT(3);
4. ¼õÉÙÁÐ
   >ALTER TABLE ab DROP COLUMN id;
5. ÐÞ¸ÄÁеÄ˳Ðò
    Öؽ¨Ò»¸ö±í£¬½«¾É±íµÄÊý¾Ýµ¼Èëбí
    mysql> INSERT INTO new_table
            -> SELECT columns-in-new-order from old_table;


Ïà¹ØÎĵµ£º

´øÄãÉîÈëÁ˽âMySQLÓï¾äÓÅ»¯µÄ»ù±¾Ô­Ôò


 
 
MySQLÓï¾äÓÅ»¯µÄ»ù±¾Ô­Ôò£º
¡ô1¡¢Ê¹ÓÃË÷ÒýÀ´¸ü¿ìµØ±éÀú±í¡£
ȱʡÇé¿öϽ¨Á¢µÄË÷ÒýÊÇ·ÇȺ¼¯Ë÷Òý£¬µ«ÓÐʱËü²¢²»ÊÇ×î¼ÑµÄ¡£ÔÚ·ÇȺ¼¯Ë÷ÒýÏ£¬Êý¾ÝÔÚÎïÀíÉÏËæ»ú´æ·ÅÔÚÊý¾ÝÒ³ÉÏ¡£ºÏÀíµÄË÷ÒýÉè¼ÆÒª½¨Á¢ÔÚ¶Ô¸÷ÖÖ²éѯµÄ·ÖÎöºÍÔ¤²âÉÏ¡£Ò»°ãÀ´Ëµ£º
a.ÓдóÁ¿Öظ´Öµ¡¢ÇÒ¾­³£Óз¶Î§²éѯ£¨ > ,< £¬> =,& ......

mysql µ¼Èë¡¢µ¼³öÊý¾Ý¿â¡¢±í

mysql µ¼³ö±í£º
mysqldump -u Óû§Ãû -p  --opt  Êý¾Ý¿âÓû§Ãû ±íÃû
> ±íÃû.sql
mysql µ¼³öÊý¾Ý¿â£º
mysqldump -u
Óû§Ãû -p  --opt  Êý¾Ý¿âÓû§Ãû
>
Êý¾Ý¿â
Ãû.sql
mysql µ¼Èë±í£º
>source e:\base\pet.sql;
mysql µ¼Èë±íÊý¾Ý£º
>LOAD DATA LOCAL INFILE 'e:path/pet.txt ......

sqliteºÍpdo mysqlµÄÊý¾Ý¿â²Ù×÷

½ñÌìµÄѧϰÄÚÈÝÊÇsqliteºÍPDO mysql¡£
ÓÃ×Ô¼ºµÄ»°ËµËµÁ½¸ö¶«Î÷°É£º
sqliteËãÊÇÒ»ÖÖ²»ÏµÍ³µÄÊý¾Ý¿â´æ´¢·½Ê½£¬ËüµÄ´æ·Å¸ñʽÊÇÒ»¸ö.dbºó׺µÄÎļþ£¬ÔÚphpÖÐËü´æ·ÅÔÚµ±Ç°µÄĿ¼Ï£¬Ã²ËƲ»ÓÃÓû§ÃûÃÜÂ룬°²È«ÐԽϵͣ¬È´±È½Ï·½±ã¡£PHP5ÖÐ×Ô´øµÄһЩϵͳº¯Êý£¬¶¼ÊÇÒÔsqlite_¿ªÍ·µÄ¡£
PDOÈ«³ÆPHP Data Object£¬¹ËÃû˼Òå¾ÍÊÇPHPµÄÒ ......

ÓÅ»¯MYSQLÊý¾Ý¿âµÄ·½·¨

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

Mysql ѧϰ±Ê¼Ç

 ÏÔʾËùÓÐÊý¾Ý¿â show databases;
 ´´½¨Êý¾Ý¿â create dababase stu;
 É¾³ýÊý¾Ý¿âdrop database stu;
 Çл»µ½Êý¾Ý¿âuse stu;
 È¡µÃµ±Ç°µÄÊý¾Ý¿â,´ø£¨£©±íʾº¯Êý:select database();
´´½¨±í£¨ÒªÇл»µ½Êý¾Ý¿âÖУ©
mysql> create table stu_info(
   
-> stu_id int(8) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ