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 8701981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:32:10+00:00 2026-06-13T02:32:10+00:00

I am using the sqlite3 library of python to process a Wikipedia .sql data

  • 0

I am using the sqlite3 library of python to process a Wikipedia .sql data dump, and I get the following “syntax error” report:

sqlite3.OperationalError: no such table: categorylinks

Below are the steps I have taken to import the .sql into my database

import sqlite3
con = sqlite3.connect('wikicategories.db')
infile = open('enwiki-latest-categorylinks.sql')
str = infile.read()
cur = con.cursor()
cur.execute(str)

and the beginning of the .sql file looks like this:

CREATE TABLE `categorylinks` (
  `cl_from` int(8) unsigned NOT NULL DEFAULT '0',
  `cl_to` varbinary(255) NOT NULL DEFAULT '',
  `cl_sortkey` varbinary(230) NOT NULL DEFAULT '',
  `cl_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `cl_sortkey_prefix` varbinary(255) NOT NULL DEFAULT '',
  `cl_collation` varbinary(32) NOT NULL DEFAULT '',
  `cl_type` enum('page','subcat','file') NOT NULL DEFAULT 'page',
  UNIQUE KEY `cl_from` (`cl_from`,`cl_to`),
  KEY `cl_timestamp` (`cl_to`,`cl_timestamp`),
  KEY `cl_collation` (`cl_collation`),
  KEY `cl_sortkey` (`cl_to`,`cl_type`,`cl_sortkey`,`cl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary;

I really didn’t see any problem with the int(8) unsigned NOT NULL DEFAULT part. And this file is released by wikipedia hence should be ready to use. I know that the Python sqlite3 has a slightly different implementation w.r.t MySQL. Does it have something to do with this?

  • 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-13T02:32:12+00:00Added an answer on June 13, 2026 at 2:32 am

    This is not SQL as understood by SQLite. Loading it with sqlite3 produces an error.

    % sqlite3 < enwiki-latest-categorylinks.sql
    Error: near line 1: near "unsigned": syntax error
    

    This has nothing to do with Python.

    You have two options:

    1. Import the SQL file with MySQL.
    2. Convert it to SQL that SQLite can understand.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the sqlite3 standard library in python 2.6.4, the following query works fine on
After Installing Rails 3, I get the following error regarding Sqlite3 when I try
I'm using sqlite3 and this would be pretty easy if it supported TOP syntax
I am using sqlite3 in python. I have two tables with id column in
hi i am working on a django python application using sqlite3 database. I have
I'm building a database library for my application using sqlite3 as the base. I
I'm using the Ruby Sqlite3 library to insert some records into a database. I'm
I'm using the SQLite3 database system in the Android library. I need to execute
I am creating a database application using the SQLite3 library. I have created a
I'm using the sqlite3 library in c++ to query the database from *.sqlite file.

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.