溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Ubuntu 12.04下SQLite數據庫怎么用

發(fā)布時間:2021-10-25 10:59:05 來源:億速云 閱讀:209 作者:小新 欄目:系統運維

小編給大家分享一下Ubuntu 12.04下SQLite數據庫怎么用,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

在Ubuntu 12.04下進行SQLite開發(fā)簡單實例如下:

1、 安裝SQLite3

hadron@hadron ~ $ sudo apt-get install sqlite sqlite3

2、 查看版本號

hadron@hadron ~ $ sqlite3 -version

3、 創(chuàng)建test數據庫

hadron@hadron ~ $ sqlite3 test.db

SQLite version 3.7.9 2011-11-01 00:52:41

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

sqlite>

4、 查看數據庫

sqlite> .database

seq  name             file

---  ---------------  ----------------------------------------------------------

0    main             /home/hadron/test.db

5、 創(chuàng)建數據表

sqlite> create table user(id,username,password);

6、 插入數據

sqlite> insert into user(id,username,password) values(1,'abc','123');

7、 查詢數據

sqlite> select * from user;

1|abc|123

8、 退出數據庫

sqlite> .exit

9、 再次進入數據庫

hadron@hadron ~ $ sqlite3

SQLite version 3.7.9 2011-11-01 00:52:41

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

sqlite>

10、安裝可視化工具:

hadron@hadron ~ $ sudo apt-get install sqlitebrowser

 Ubuntu 12.04下SQLite數據庫怎么用 

Ubuntu 12.04下SQLite數據庫怎么用

以上是“Ubuntu 12.04下SQLite數據庫怎么用”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業(yè)資訊頻道!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI