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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:55:41+00:00 2026-05-27T00:55:41+00:00

I created 4 columns for a table cur.execute(CREATE TABLE videoinfo ( id INT UNSIGNED

  • 0

I created 4 columns for a table

cur.execute("""CREATE TABLE videoinfo (
    id INT UNSIGNED PRIMARY KEY AUTO INCREMENT, 
    date DATETIME NOT NULL, 
    src_ip CHAR(32), 
    hash CHAR(150));
""")

I have a .txt file which has three columns of data inside. I want to use LOAD DATA LOCAL INFILEcommand to insert data, but the problem is ,the table I created now has four columns, the first one is the id, so, can mysql automatically insert data from the second column or extra command is needed?

Many thanks!

  • 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-05-27T00:55:42+00:00Added an answer on May 27, 2026 at 12:55 am

    AUTO INCREMENT isn’t valid syntax. If you check MySQL’s documentation for the CREATE TABLE statement, you’ll see the proper keyword is AUTO_INCREMENT.

    Additionally, date is a keyword, so you’ll need to quote it with backticks, as mentioned on the MySQL identifier documentation page. The documentation also lists all keywords, which must be quoted to use them as identifiers. To be safe, you could simply quote all identifiers.

    To insert data only into some columns, you can explicitly specify columns. For LOAD DATA INFILE:

    LOAD DATA INFILE 'file_name'
        INTO TABLE videoinfo
        (`date`, src_ip, hash)
    

    For the INSERT statement:

    INSERT INTO videoinfo (`date`, src_ip, hash)
      VALUES (...);
    

    This, too, is revealed in the MySQL manual. Notice a pattern?

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

Sidebar

Related Questions

I'm trying to create a table with two columns comprising the primary key in
First.. here are the two tables I've created (sans irrelevant columns).. CREATE TABLE users_history1
How would you reference table1 columns to 2 columns in table 2 I created
Okay, here's the situation: We have a table of about 50 columns (created by
I have two columns in my table and the rows are created dynamically. <table
Can I create a table without any columns in SQL Server by t-sql?
I have large table. consisting of only 3 columns (id(INT),bookmarkID(INT),tagID(INT)).I have two BTREE indexes
I just created new columns in my database for my micropost table and these
I have created a temporary table with dynamic columns. These columns are the values
I want to create a table with multiple columns, say about 100 columns, in

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.