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

SQLITEÈëÃÅ Öð²½½²½âSQLITEÃüÁîÐÐ(Èý)

backup ?DB? FILE ±¸·ÝÊý¾Ý¿âµ½Îļþ£¬Ä¬Èϱ¸·ÝµÄÊÇmainÊý¾Ý¿â,Èç¹û²»¸½¼ÓÊý¾Ý¿â£¬test.dbÎļþÖÐĬÈϵÄÖ»ÓÐmainÊý¾Ý¿â¡£ ÃüÁî²Ù×÷¾ÙÀý£º
sqlite> .backup mydb.bak
sqlite>
´Ëʱ¿ÉÒÔÔÙFÅÌ¿´µ½mydb.bakÎļþ£¬ÓüÇʱ¾´ò¿ªËäÈ»ÊÇÂÒÂ룬µ«¿É¿ú¼ûÒ»°ß¡£
.restore ?DB? FILE ´Ó±¸·ÝÎļþ»¹Ô­Êý¾ÝºÍ.backupÏà¶ÔÓ¦. ½ÓÉÏÒ»²½£¬ÎÒÃÇ¿ÉÒÔctrl+c½áÊøÃüÁÎÒÃÇÔÙ½¨Á¢Ò»¸öеĿ⣬À´ÓÃmydb.bakÎļþ»¹Ô­£¬ÃüÁîÈçÏ£º
sqlite> ^C
F:\>sqlite3 test0.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> ;
sqlite> .restore mydb.bak
sqlite>
ÑéÖ¤Êý¾ÝÈçÏ£º
sqlite> select * from websites;
1|CTOChina.net
2|ËѺü
3|ÑÅ»¢
sqlite>
ΪÁËϱߵÄ˳Àû½øÐУ¬ÎÒÃÇÖØдò¿ªtest.dbÊý¾Ý£º
sqlite> ^C
F:\>sqlite3 test.db
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
.bail ON|OFF Óöµ½´íÎóÊǼÌÐø»¹ÊÇÖÕֹѡÏî,ĬÈÏÊÇÖÕÖ¹.
.databases ÏÔʾÎļþÖÐÊý¾Ý¿âÁбí,Èç¹ûûÓи½¼ÓÊý¾Ý¿âµÄÇé¿öÏ£¬ÎļþÖÐÖ»ÓÐmainÊý¾Ý¿â¡£È磺
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------
0 main F:\test.db
sqlite>
ת×Ô£ºhttp://www.ctochina.net/topic/ShowCArticle/348.html


Ïà¹ØÎĵµ£º

ÔÚsqliteÊý¾Ý¿âÖУ¬intÀàÐͲ»µÈÓÚintegerÊý¾ÝÀàÐÍ

ÕâЩÌìÒ»Ö±ÔÚæÏúÊÛ¹ÜÀíÈí¼þÒ×Âôͨ¿Í»§¶ËµÄ³ÌÐò±àд£¬ÓÉÓÚÐèÒª²ÉÓñ¾µØÊý¾Ý»º´æ»úÖÆÀ´Ìá¸ß³ÌÐòµÄÊý¾Ý·ÃÎÊЧÂÊ£¬ËùÒÔÐèÒªÔÚ¿Í»§¶ËʹÓÃÒ»¸öСÇɵı¾µØÊý¾Ý¿â¡£Õâ¸öÊý¾Ý¿âµ±È»ÒªÐ¡¶ø¾«º·µÄ¡£ÎÒÒ²²»Ïë×öÇ¿µÁ£¬ÓÚÊǾÍÑ¡ÔñSqlite°É——ÎļþÊý¾Ý¿â£¬Ö»ÒªÒ»¸öSqlite.dll¾Í¿ÉÒÔ²Ù×÷Êý¾Ý¿â¡£
²»µÃ²»³ÃÈ˱¾ÈËÊÇÓеã͵ÀÁ£¬Ad ......

ÔÚ.NET C#ÖÐʹÓÃsqlite

 1¡£´Ówww.sqlite.orgÏÂÔØSQLite 3.3.4µÄ°æ±¾
ΪÁË·½±ã£¬ÎÒ°ÑËü½âѹÁË£¬¾ÍÒ»¸öSQLite3.exe£¬·ÅÈëWindowsĿ¼Ï¡£
Cmd ½øÈëÃüÁîÐÐ
1)
´´½¨Êý¾Ý¿âÎļþ:
>SQLite3 d:\test.db »Ø³µ
¾ÍÉú³ÉÁËÒ»¸ötest.dbÔÚdÅÌ¡£
ÕâÑùͬʱҲSQLite3¹ÒÉÏÁËÕâ¸ötest.db
2)
ÓÃ.help¿ÉÒÔ¿´¿´ÓÐʲôÃüÁî
>.help »Ø³µ¼´¿É
3)¿ÉÒ ......

SQLiteÖеÄÈ«ÎÄËÑË÷

    °ÝGoogleµÄScott Hessͬ־Ëù´Í£¬SQLiteÒ²ÍƳöÁËÈ«ÎÄËÑË÷¹¦ÄÜ¡£
    SQLiteͨ¹ý½¨Á¢Ò»¸öÐéÄâ±í£¬½«ÊäÈëµÄÎÄ×Ö¸ù¾Ý¿Õ¸ñ¡¢±êµã·ûºÏµÈ¹æÔò½øÐзִʣ¬×éÖ¯³ÉÒ»¿ÃBÊ÷£¬ÒÔ´ËÀ´Ìá¸ßËÑË÷Ëٶȡ£
    ÈçºÎʹÓÃÕâÒ»¹¦ÄÜ£¬ÐÔÄÜÉÏÈçºÎ£¬´ó¼Ò¸÷×ÔÑо¿È¥°É¡£
    ÔÚÕâÀ ......

SQLiteѧϰ±Ê¼Ç

 SQLiteѧϰ±Ê¼Ç
1.²é¿´ÓÐÄÄЩÊý¾Ý¿â,ÏÔʾÊý¾Ý¿âÁбí
show databases;
2.ÏÔʾ±íµÄ½á¹¹
·½·¨Ò»£º
use student;
describe student;
·½·¨¶þ£º
des student.student;
·½·¨Èý£º
show columns from student;
3.ÏÔʾMYSQLµÄ°æ±¾
select version();
4.ÏÔʾ¿âÖеÄÊý¾Ý±í
use  mysql;
show tables;
5.½¨¿â ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ