Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9030801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:34:52+00:00 2026-06-16T07:34:52+00:00

I have a file which contains some SQL commands, something that looks like this:

  • 0

I have a file which contains some SQL commands, something that looks like this:

CREATE DATABASE IF NOT EXISTS `db_name`;
USE `db_name`;

CREATE TABLE IF NOT EXISTS `customers` (
  `id` int(10) unsigned NOT NULL,
  `f_name` varchar(50) DEFAULT NULL,
  `l_name` varchar(50) DEFAULT NULL,
  `company_name` varchar(200) DEFAULT NULL,
  `email` varchar(50) DEFAULT NULL,
  `phone` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `customers` (`id`, `f_name`, `l_name`, `company_name`, `email`, `phone`) VALUES
    ...
    ...
    ...

I’d like to use these commands to create an SQLite3 database file in order to use it easily with Python.

How do I do that on Ubuntu?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:34:53+00:00Added an answer on June 16, 2026 at 7:34 am

    That isn’t quite an SQL file, that contains a bunch of MySQL-specific stuff some of which SQLite will accept and some it won’t. We’ll start at the top.

    You don’t need create database or use with SQLite. If you want to create a database just name it when you run sqlite3 from the command line:

    $ sqlite3 db_name.sqlt < your_sql.sql
    

    If db_name.sqlt exists then it will be used, if it doesn’t exist then it will be created. So create database and use are implied by how you run sqlite3. You might need to use a different extension depending on what Python wants to see.

    The backticks for quoting are a MySQLism, double quotes are the standard quoting mechanism for identifiers. Lucky for you, SQLite will accept them so you can leave them alone.

    SQLite won’t know what int(10) unsigned means, you’ll have to remove the unsigned before SQLite will accept it. SQLite also won’t know what ENGINE=InnoDB DEFAULT CHARSET=utf8 means so you’ll have to remove that as well.

    You’ll probably run into other things that MySQL is happy with but SQLite is not. You’ll have to try it and fix it and try it and fix it until it works. Or try to find a tool that can translate between databases for you, I always do these sorts of things by hand or using one-off scripts so I don’t know of any tools that can help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a .sql file which contains the exported code from some database #
I have file which contains some data, like this 2011-01-02 100100 1 2011-01-02 100200
I have an .sql file which contains some data like first_name, last_name, email etc.
What I am doing is that I have a file which contains some data
I have a ini file which contains some sample values like: [Section1] Value1 =
Hi I have a text file which contains some numerical data. Of that text
i have a file which contains a lot of update query and some other
I have a JSON file which contains a pound symbol in it. This json
I have a SQL Sever 2008 R2/64-bit database server for which I'm writing some
I have an XML file which contains some data as given. <?xml version=1.0 encoding=UTF-8

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.