mysqlÊý¾Ý¿âµÄµ¼Èëµ¼³ö
Ò»¡¢MYSQLµÄµ¼³ö
½øÈëmysql°²×°Ä¿Â¼£¬½øÈëbin
ÔÚÃüÁîÐÐģʽÏ´òÈ룺
³ÌÐò´úÂë
mysqldump -u root -p hibernate > c:/hibernate.sql
ÆäÖÐ-u ±íʾÓû§
-p±íʾÓû§ÐèÒªÈÏÖ¤
hibernate±íʾҪµ¼³öµÄÊý¾Ý¿â
> c:/hibernate ±íʾ½«Êý¾Ý¿âÎļþdumpµ½cÅ̵Ähibernate.sqlÎļþµ±ÖÐ
¶þ¡¢MYSQLµÄµ¼Èë
½øÈëmysql¿ØÖÆ̨£¬´´½¨Ò»¸öеÄÊý¾Ý¿â£¬Êý¾Ý¿âÃûÀýÈç½Ðhibernate
³ÌÐò´úÂë
mysql -u root -p hibernate < c:/hibernate.sql
Í˳öÖ®ºó£¬ÔÚmysql/binĿ¼£¬ÊäÈëÒÔÏÂÃüÁî
³ÌÐò´úÂë
mysql -u root -p hibernate < c:/hibernate.sql
Ïà¹ØÎĵµ£º
MySQLÓï¾äÓÅ»¯µÄ»ù±¾ÔÔò£º
¡ô1¡¢Ê¹ÓÃË÷ÒýÀ´¸ü¿ìµØ±éÀú±í¡£
ȱʡÇé¿öϽ¨Á¢µÄË÷ÒýÊÇ·ÇȺ¼¯Ë÷Òý£¬µ«ÓÐʱËü²¢²»ÊÇ×î¼ÑµÄ¡£ÔÚ·ÇȺ¼¯Ë÷ÒýÏ£¬Êý¾ÝÔÚÎïÀíÉÏËæ»ú´æ·ÅÔÚÊý¾ÝÒ³ÉÏ¡£ºÏÀíµÄË÷ÒýÉè¼ÆÒª½¨Á¢ÔÚ¶Ô¸÷ÖÖ²éѯµÄ·ÖÎöºÍÔ¤²âÉÏ¡£Ò»°ãÀ´Ëµ£º
a.ÓдóÁ¿Öظ´Öµ¡¢ÇÒ¾³£Óз¶Î§²éѯ£¨ > ,< £¬> =,< ......
ÏÔʾËùÓÐÊý¾Ý¿â show databases;
´´½¨Êý¾Ý¿â create dababase stu;
ɾ³ýÊý¾Ý¿âdrop database stu;
Çл»µ½Êý¾Ý¿âuse stu;
È¡µÃµ±Ç°µÄÊý¾Ý¿â,´ø£¨£©±íʾº¯Êý:select database();
´´½¨±í£¨ÒªÇл»µ½Êý¾Ý¿âÖУ©
mysql> create table stu_info(
-> stu_id int(8) ......
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. ÐÞ¸ÄÁ ......
×öÏîĿʱÓÉÓÚÒµÎñÂß¼µÄÐèÒª£¬±ØÐë¶ÔÊý¾Ý±íµÄÒ»Ðлò¶àÐмÓÈëÐÐËø£¬¾Ù¸ö×î¼òµ¥µÄÀý×Ó£¬Í¼Êé½èÔÄϵͳ¡£¼ÙÉè
id=1
µÄÕâ±¾Êé¿â´æΪ
1
£¬µ«ÊÇÓÐ
2
¸öÈËͬʱÀ´½èÕâ±¾Ê飬´Ë´¦µÄÂ߼Ϊ
Select restnum from book where id =1 ;
-- Èç¹û restnum ´óÓÚ 0 £¬Ö´ÐÐ update
Update boo ......