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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:36:32+00:00 2026-05-16T04:36:32+00:00

I have a python script that connects to a local MySQL db. I know

  • 0

I have a python script that connects to a local MySQL db. I know it is connecting correctly because I can do this and get the proper results:

cursor.execute(“SELECT * FROM reel”)

But when I try to do any insert statements it just does nothing. No error messages, no exceptions. Nothing shows up in the database when I check it from sqlyog. This is what my code looks like:

self.cursor.executemany(“INSERT INTO reel (etime,etext) VALUES (%s,%s)”, tups)

where tups is a list of tuples looking like this (‘0000-00-00 00:00:00′,’text’). No errors show up and if I copy paste the generated SQL query into sqlyog it works. I’ve tried generating the query and doing cursor.execute() on it and no errors and no result either. Anyone know what I’m doing wrong?

  • 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-16T04:36:33+00:00Added an answer on May 16, 2026 at 4:36 am

    You need to do a self.cursor.commit() after self.cursor.executemany("INSERT INTO reel (etime,etext) VALUES (%s,%s)", tups)

    Starting with 1.2.0, MySQLdb disables autocommit by default, as required by the DB-API standard (PEP-249). If you are using InnoDB tables or some other type of transactional table type, you’ll need to do connection.commit() before closing the connection, or else none of your changes will be written to the database.

    Conversely, you can also use connection.rollback() to throw away any changes you’ve made since the last commit.

    Important note: Some SQL statements — specifically DDL statements like CREATE TABLE — are non-transactional, so they can’t be rolled back, and they cause pending transactions to commit.

    Is a FAQ

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

Sidebar

Ask A Question

Stats

  • Questions 495k
  • Answers 495k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Upgrade to the latest version (6.0). That has support for… May 16, 2026 at 11:20 am
  • Editorial Team
    Editorial Team added an answer You could use an async request to fill the div… May 16, 2026 at 11:20 am
  • Editorial Team
    Editorial Team added an answer To disable triggers you can do: Trigger 1 SET @disable_trigger… May 16, 2026 at 11:20 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a python script that connects to an external host, fetches some data,
I have a python sgi script that attempts to extract an rss items that
I have a python script that is trying to create a directory tree dynamically
I have a simple python script that just takes in a filename, and spits
I had trouble installing a local installation of mysql, so I have a connection
I have created a PHP-script to update a web server that is live inside
I have a script that fetches several web pages and parses the info. (An
I have a bash backup script run as root (cron) that delegates certain tasks
I have been receiving errors when trying to save and run this Python 3.1
I have a bunch of Python modules I want to clean up, reorganize and

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.