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
-1
votes
1 answer

PymySQL insert and update separing request to param values

I'm separing my request to the values for more security, using pymysql for python 2.7. I have dynamic parameters so I'm using .join() to build my request. This is how I do: def updateItem(self, table, body, where): print 'updateItem' if body…
-1
votes
1 answer

How to pass parameter in URL to other function in Flask

So essentially I'd like to be able to type in the URL e.g. http://example.com/"something", and if there is nothing render the index.html. For some reason that isn't working. On the other side i'd like to be able to pass that parameter, e.g.…
-1
votes
1 answer

InternalError: (1054, u"Unknown column 'Ihe' in 'where clause'")

Below is a part of my python/pymysql code. I'm basically trying to retrieve data from a database using the input typed into a search box. I don't understand why the data typed in is coming across with this error. "Ihe" is simply a test hostname in…
Taras Tataryn
  • 21
  • 1
  • 8
-1
votes
1 answer

Improve MySQL Performance

Info: MySQL Community 5.7.12 64 bits Programming Language: Python 3.5 mysqld.cnf: Mysqld.cnf result of "show variables" show variables Description: - I have 200 000 tasks. - I process these tasks with 500 threads, one per task, when a thread…
Christian Salvador
  • 311
  • 1
  • 4
  • 12
-1
votes
1 answer

python pymssql at windows encode

I connection to Mssql server on python 2.7 by pymssql. Connection string is: mssql+pymssql://user:pass@server:1433/DB And Collation of server is Cyrillic_General_CI_AS. When i try select from table with column of varchat it return string: u'ÎÎÎ…
Ivan Bryzzhin
  • 2,009
  • 21
  • 27
-1
votes
4 answers

PyMySQL Syntax when using two tables

I have 2 mysql tables: -Attendance: att id | child id -------------------------- A0012 | C002 A0034 | C001 A0064 | C003 A0065 | C003 A0066 | C003 -Day Prices: att id | price |…
user4490696
-1
votes
1 answer

Insert with pymysql with python error

I am attempting to do an INSERT in MySQL: insert = "INSERT INTO newspapers (title , description, newspaper, updated) VALUES ('{0}','{1}','{2}','{3}')".format( str(title), str(description), str(id), str(updated)) I get this…
Fabián
  • 1
  • 2
-1
votes
1 answer

mysql 5.5 utf-8 collation utf8_unicode_ci, pymysql

I've a problem with mysql 5.5 on os x. I'm working on a multilanguages project and using MyISAM table. the default characterset is utf-8 and default collation utf8_unicode_ci. Italian and German are fine, but spanish is not. I'm using python for…
xaverras
  • 2,577
  • 2
  • 17
  • 15
-2
votes
1 answer

Connection' object has no attribute 'execute' pymysql

Every time I try to create an account I get this error message: Connection' object has no attribute 'execute' Thank you for helping me. I am working on an absence management form. I am in the account creation phase. I have set up a MySQL database in…
-2
votes
3 answers

How do I return large number of columns from mysql database using AWS Lambda?

A brief background: I have a serverless mysql database connected to AWS RDS which consists of 70 columns and 7000+ rows. Many of the columns defined in this RDS have datatype as VARCHAR(2000), BIGINT. I'm trying to return all the details in this…
r42
  • 116
  • 1
  • 1
  • 7
-2
votes
1 answer

not able to import the csv file into sql server using python's pymysql

I have a very simple csv file having 3 columns having names 'a', 'b', 'c' of integer types having 5 columns. I want to import this data into SQL server in a database with pymysql. can somebody provide me the code for this? Also is PHPMyAdmin is…
anadi
  • 63
  • 1
  • 6
-2
votes
1 answer

How are the keys defined in pymysql if we use DictCursor?

I was looking for a way to better represent the output we get after running a query on a MySQL table via pymysql and stumbled upon DictCursor. I gave it a shot and was able to achieve the following import pymysql # Connect to mysql database conn =…
Devesh Kumar Singh
  • 20,259
  • 5
  • 21
  • 40
-2
votes
2 answers

Connecting Python notebook to MySQL Database

How can I connect a MySQL database to my Jupyter notebook to execute queries using Python notebook? My code: import pymysql conn = MySQLdb.connect(host=dsn_hostname, port=dsn_port, user=dsn_uid, passwd=dsn_pwd, db=dsn_database) After establishing…
Hello.World
  • 720
  • 8
  • 22
-2
votes
1 answer

Will this SQLite based Python code be compatible with MySQL?

I have a Python 3 application that uses SQLite directly, by executing SQL code strings (i.e., without using a ORM like SQLalchemy). The database is being initialized like this: def db_inicialize(): global DB_PATH print(" - Opening…
Victor Domingos
  • 1,003
  • 1
  • 18
  • 40
-2
votes
1 answer

Select from MySql with a variable

I'm trying to search in a database with python3 with PyMySQL. I want to have a list of ips, that can be put in a database and return that data to the ip address. But i can't even search for one ip. Is it possible or not ? ip =…
Jesper Petersen
  • 77
  • 3
  • 10
1 2 3
91
92