Questions tagged [pymysql]

PyMySQL is a database connector for Python like MySQLdb.

PyMySQL is a database connector for Python, that means it is a library to enable Python programs to talk to a MySQL server.

It is written in pure Python and works with Python 2.7+ and Python 3.X.

pymysql is a drop-in replacement for mysqldb.

Documentation can be found at https://pymysql.readthedocs.io/

1369 questions
-3
votes
1 answer

How to take sum of column on grouping rows of column 1 in dataframe

This is my data frame attached in image and I want to sum as per the first column where ?? represent no value for that entry DATAFRAME IMAGE SAMPLE I want to write code to have an output like below HWK 0 CSP 0 DCF 0 I want to sum the values only if…
Vikas D
  • 3
  • 4
-3
votes
1 answer

pymysql.err.ProgrammingError when running tkinter+pymysql script

Consider this code: from tkinter import * import pymysql def newc(): def inr1(): var1 = var.get() connection = pymysql.connect(host='localhost', user='root', password='', db='class') cursor = connection.cursor() …
Harish P
  • 21
  • 2
-4
votes
1 answer

Invalid syntax in executing SQL query using python

I am trying to run the below SQL query using pymysql in python cursor.execute(""SELECT count(1) from user_login WHERE user_id="+username + "and password="+password"") Here username=abc and password=xyz are variables with values I know there is a…
Nishanth
  • 55
  • 1
  • 1
  • 6
-5
votes
1 answer

What is the correct syntax for pymysql commands?

I can't execute the query. pymysql is already installed using pip install pymymql. Code import pymysql db = pymysql.connect(host='localhost', user='root', passwd='') cursor = db.cursor() query = ("SHOW DATABASES") cursor.execute(query) for r in…
iceking
  • 1
  • 2
1 2 3
91
92