Ubuntu-sqlite Install

Source: Internet
Author: User
Tags sqlite

  1. Reference: http://www.linuxidc.com/Linux/2013-08/89155.htm

  2. Installing Sqlite3sudo

    1. Apt-get Install Sqlite3

  3. Install the required toolkit for SQLITE3 compilation

    1. If you need to, you can install the toolkit. Just to experience a piece, you can not install it. This option is optional.

    2. Apt-get Install Libsqlite3-dev

  4. The SQLite version number, such as 3.6.22, appears when you execute the following command

    1. Sqlite3-version

  5. To install the graphical interface (if you do not like the command line, it is necessary to install it.) This option is optional.

    1. Sudo apt-get install  sqlitebrowser

    2. Run sqlitebrowser:$ sqlitebrowser       

  6. Install support for additional languages:

    1. //php support sudo apt-get  install php5-sqlite 

    2. //ruby supports   sudo apt-get  install libsqlite3-ruby 

    3. //python support   Sudo apt-get  install  python-pysqlite2  

  7. Create a database (can be in any directory (such as/home/mark/database), execute the following command:)

    1. Sqlite3 test.db (Note: After this command executes, if there is no test.db in the current directory, the file is created and used directly if it already exists.) Use. Database to view the databases created 650) this.width=650; "Src=" Http://www.linuxidc.com/upload/2012_05/120517091279721.gif " Vspace= "5" width= "581"/>

  8. Create a table

    1. Data type, you can refer to the official documentation.

    2. CREATE TABLE MyTable (name varchar (ten), age smallint);

    3. Similarly, use. table to see the table you created MyTable

  9. Inserting data into a table

    1. INSERT INTO mytable values (' Mark ',+);

    2. INSERT INTO mytable values (' Hello ',+);

  10. Querying data

    1. SELECT * FROM MyTable;

    2. Query Result:

      650) this.width=650; "src=" Http://www.linuxidc.com/upload/2012_05/120517091279722.gif "/>

  11. To delete a table:

    1. drop table mytable;

  12. To delete a database:

    1. Unfortunately, SQLite is unable to delete the database file like any other database, that is, drop DB test, but we can delete the database file just like deleting a file, and delete the test.db file under/home/mark/database.

This article is from the "Mr_computer" blog, make sure to keep this source http://caochun.blog.51cto.com/4497308/1726536

Ubuntu-sqlite Install

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.