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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:30:54+00:00 2026-05-13T05:30:54+00:00

conn = MySQLdb.connect(host=’db1′, user=’user’, passwd=’pass’, db=’db’, port=3306) cursor = conn.cursor() count = int(sys.argv[1]) x

  • 0
conn = MySQLdb.connect(host='db1', user='user', passwd='pass', db='db', port=3306)
cursor = conn.cursor()

count = int(sys.argv[1])
x = 0
while x < count:
    x += 1
    cursor.execute("INSERT INTO auth_group(name) VALUES(%s)", (str(x)))
    #if I change %s to 'kkkk', it doesn't work either.

    print str(x) + ' / ' + str(count)
print 'done'

However…if I go into “mysql -uuser -ppass db”, it works:

mysql > INSERT INTO auth_group(name) VALUES('kkkkk');

I don’t know if this could be a problem…but I was having a replication issue earlier.

I would like to INSERT 99999 rows into the database. But it’s empty.

mysql> select * from auth_group;
Empty set (0.33 sec)
  • 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-13T05:30:54+00:00Added an answer on May 13, 2026 at 5:30 am

    If there’s no particular error message (in other words, it seems to work, but the insert doesn’t stick), make sure you commit() after the statement:

    conn.commit()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying conn = MySQLdb.connect (host = localhost, user = username, passwd = password,
private int GetNextId() { SQLiteConnector conn = new SQLiteConnector(false); conn.OpenConnection(); cmd = new SQLiteCommand(SELECT
SqlConnection conn = new SqlConnection(AllQuestionsPresented.connectionString); SqlCommand cmd = new SqlCommand(sb.ToString(), conn); cmd.Parameters.Add(@ThreadsID, SqlDbType.Int).Value =
while i am trying to connect with python MySQLdb, i get an 'Invalid Arguments'
import sqlite3 conn = sqlite3.connect(rD:\aaa.db) Is there a way to automatically create the db
try { PreparedStatement s = (PreparedStatement) conn.prepareStatement(SELECT voters.Check,count(*) FROM voting.voters where FirstName=+first+and LastName=+last+ and
Core dumped while running this program: int main(void) { sqlite3 *conn; int error =
Code: import time import tweepy import sqlite3 class Listener(tweepy.StreamListener): conn = sqlite3.connect('/home/daniel/Desktop/activeSites/djeep/djeep.db') def on_status(self,
I'm trying to connect to a MySQL database on a remote server using MySQLdb
include(conn.php); $result = mysql_query(SELECT * FROM sggame); while($row = mysql_fetch_assoc($result)); { $id = $row['id'];

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.