mySQL Êý¾ÝµÄµ¼Èëµ¼³ö
¼¸¸ö³£ÓÃÓÃÀý£º
1.µ¼³öÕû¸öÊý¾Ý¿â
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.µ¼³öÒ»¸ö±í
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> µ¼³öµÄÎļþÃû
mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
3.µ¼³öÒ»¸öÊý¾Ý¿â½á¹¹
mysqldump -u wcnc -p -d --add-drop-table smgp_apps_wcnc >d:\wcnc_db.sql
-d ûÓÐÊý¾Ý --add-drop-table ÔÚÿ¸öcreateÓï¾ä֮ǰÔö¼ÓÒ»¸ödrop table
4.µ¼ÈëÊý¾Ý¿â
³£ÓÃsource ÃüÁî
½øÈëmysqlÊý¾Ý¿â¿ØÖÆ̨£¬
Èçmysql -u root -p
mysql>use Êý¾Ý¿â
È»ºóʹÓÃsourceÃüÁºóÃæ²ÎÊýΪ½Å±¾Îļþ£¨ÈçÕâÀïÓõ½µÄ.sql£©
mysql>source d:\wcnc_db.sql
¿É²Î¿´ MySQLÊý¾ÝµÄµ¼³öºÍµ¼È빤¾ß:mysqldump
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
MySQLÊý¾Ýµ¼Èëµ¼³ö·½·¨Ó빤¾ß½éÉÜÖ®¶þ
http://www.coolstu.net/Article_Show.asp?ArticleID=957
Åú´¦ÀíÊÇÒ»Öַǽ»»¥Ê½ÔËÐÐmysql³ÌÐòµÄ·½·¨£¬ÈçͬÄúÔÚmysqlÖÐʹÓõÄÃüÁîÒ»Ñù£¬ÄãÈÔÈ»½«Ê¹ÓÃÕâЩÃüÁΪÁËʵÏÖÅú´¦Àí£¬ÄúÖض¨ÏòÒ»¸öÎļþµ½ mysql³ÌÐòÖУ¬Ê×ÏÈÎÒÃÇÐèÒªÒ»¸öÎı¾Îļþ£¬Õâ¸öÎı¾Îļþ°üº¬ÓÐÓëÎÒÃÇÔÚmysqlÖÐÊäÈëµÄÃüÁîÏàͬµÄÎı¾¡£±ÈÈçÎÒÃÇÒª²åÈëһЩÊý¾Ý£¬Ê¹Óðüº¬ÏÂÃæÎı¾µÄÎļþ(ÎļþÃûΪNew_Data.sql,µ±È»ÎÒÃÇÒ²¿ÉÒÔÈ¡ÃûΪNew_Data.txt¼°ÈκÎÆäËûµÄºÏ·¨Ãû×Ö£¬²¢²»Ò»¶¨ÒªÒÔºó׺sql½áβ)£º
USE Meet_A_Geek;
INSERT INTO Customers (Customer_ID, Last_Name) VALUES(NULL, "Block");
INSERT INTO Customers (Customer_ID, Last_Name) VALUES(NULL, "Newton");
INSERT INTO Customers (Customer_ID, Last_Name) VALUES(NULL, "Simmons");
×¢ÒâÉÏÃæµÄÕâЩ¾ä×ÓµÄÓï·¨¶¼±ØÐëÊÇÕýÈ·µÄ£¬²¢ÇÒÿ¸ö¾ä×ÓÒԷֺŽáÊø¡£ÉÏÃæµÄUSEÃüÁîÑ¡ÔñÊý¾Ý¿â£¬INSERTÃüÁî²åÈëÊý¾Ý¡£
ÏÂÃæÎÒÃÇÒª°ÑÉÏÃæµÄÎļþµ¼Èëµ½Êý¾Ý¿âÖУ¬µ¼Èë֮ǰҪȷÈÏÊý¾Ý¿âÒѾÔÚÔËÐУ¬¼´ÊÇmysqld½ø³Ì£¨»òÕß˵·þÎñ£¬Windows NTÏÂÃæ³ÆΪ”·þÎñ“£¬unixÏÂÃæΪ”½ø³Ì“£©ÒѾÔÚÔËÐС£È»ºóÔËÐÐÏÂÃæµÄÃüÁ
bin/mysql –p < /home/mark/New_Data.sql
½Ó×Å°´ÌáʾÊäÈëÃÜÂ룬Èç¹ûÉÏÃæµÄÎļþÖеÄÓï¾äûÓдíÎó£¬ÄÇôÕâЩÊý¾Ý¾Í±»µ¼Èëµ½ÁËÊý¾Ý¿âÖС£
ÃüÁîÐÐÖÐʹÓÃLOAD DATA INFILE ´ÓÎļþÖе¼ÈëÊý¾Ýµ½Êý¾Ý¿â:
ÏÖÔÚÄú¿ÉÄÜ»áÎÊ×Ô¼º£¬"¾¿¾¹ÎªÊ²Ã´ÎÒÒªÊäÈëËùÓеÄÕâЩSQ
Ïà¹ØÎĵµ£º
ÔÚaccessÖбíÖÐÊý¾Ýµ¼³öΪÎı¾Îļþµ½MySQLµÄÎÊÌ⣿
µ¼³öÎı¾Îļþʱºò£¬¿ÉÒÔÑ¡Ôñ×ֶηָô·û£¬À´°ÑÿһÁиô¿ª ºÍ Îı¾Ê¶±ð·û£¬À´°ÑcharÐÍÊý¾ÝÀ¨ÆðÀ´
ÎÒÏÖÔÚÓÓ£¬”×÷Ϊ×ֶηָô·û£¬²»Ê¹ÓÃÎı¾Ê¶±ð·û
Éú³ÉµÄÎı¾ÎļþÈçÏÂ
1£¬ÕÅÈý£¬ÄУ¬£¬Öйú ÉϺ££¬80501206
2£¬ÍõÎ壬Ů£¬Öйú ±±¾© ......
For SQL Server2008:
http://www.microsoft.com/downloads/details.aspx?FamilyID=0e6168b0-2d0c-4076-96c2-60bd25294a8e&displaylang=en
For SQL Server2005:
http://www.microsoft.com/downloads/details.aspx?familyid=C6F14640-DA22-4604-AAAA-A45DE4A0CD4A&displaylang=en ......
1.¹Ø¼ü×Ö
auto_increment
2.×ÔÔöÓ÷¨
Àý:
CREATE TABLE animals ( id mediumint not null auto_increment,
name char(30) not null,
primary key (id));
3.¹ØÓÚ×ÔÔö
Q:Ôõô»ñµÃµ±Ç°µÄ×ÔÔöµÄ×î´óÖµ?
A:select @@identity
Q:Ôõô»ñµÃtableµÄµ±Ç°×ÔÔö×î´óÖµ?
A:select max(i ......
Èç¹û´ó¼ÒÓÐÒìÒ飬¿ÉÒÔÔÚºóÃæ²¹³ä¡£ÎÒ»áËæʱ¸üеġ£
ÏÖÔÚ´ó¸ÅÁгöÈçÏÂ:(Íû¸÷λ²¹³ä)
1.Êý¾Ý¿âµÄÉè¼Æ
¾¡Á¿°ÑÊý¾Ý¿âÉè¼ÆµÄ¸üСµÄÕ¼´ÅÅÌ¿Õ¼ä.
1).¾¡¿ÉÄÜʹÓøüСµÄÕûÊýÀàÐÍ.(mediumint¾Í±Èint¸üºÏÊÊ).
2).¾¡¿ÉÄܵĶ¨Òå×Ö¶ÎΪnot null,³ý·ÇÕâ¸ö×Ö¶ÎÐèÒªnull.£¨Õâ¸ö¹æÔòÖ»ÊʺÏ×Ö¶ÎΪKEYµÄÇéÐΣ©
3).Èç¹ûûÓÐÓõ½±ä³¤×Ö¶ÎµÄ ......
Ò»¡¢MySQL5.1°²×°
´ò¿ªÏÂÔصݲװÎļþ£¬³öÏÖÈçϽçÃ棺
mysql°²×°Ïòµ¼Æô¶¯£¬µã»÷“next”¼ÌÐø
Ñ¡Ôñ°²×°ÀàÐÍ£¬ÓГTypical£¨Ä¬ÈÏ£©”¡¢“Complete£¨ÍêÈ«£©”¡¢“Custom£¨Óû§×Ô¶ ......