All Questions
Tagged with database-connection mysql-python
20
questions
0
votes
0answers
109 views
Flask - mysql.connector pooling concept, design and development
Currently I'm developing a web application using Flask framework and plan to use pooling method to manage MYSQL DB connection to reduce the overhead in establishing new connection for each user ...
0
votes
1answer
55 views
OperationalError: (1698, “Access denied for user 'cotequotey'@'localhost'”)
Even after trying the methods in this threadERROR 1698 (28000): Access denied for user 'superuser1'@'localhost', I still have the same error with my username 'cotequotey' which reads:
...
0
votes
1answer
686 views
Python connection to mysql error : unexpected indent [closed]
I am new to Python.
Here is the code I have written to insert a row to a mysql table:
db = MySQLdb.connect(host="localhost", # your host, usually localhost
user="me", ...
0
votes
1answer
382 views
Python MYSQL update
I am using this below code to update the records of my table but it doesn't work and it doesn't update my table
conn = mysql.connector.connect(host='localhost',
...
0
votes
1answer
121 views
Template for MySQL Table Creation - Python
I am creating one table per user in my database and later storing data specific to that user. Since I have 100+ users, I was looking to automate the table creation process in my Python code.
Much ...
0
votes
0answers
289 views
MySQL connector/python connection on mac
Hi guys m using python 3.5 and MySQL connector python-2.1.5 on MacBook.
I got the error as NameError: name 'conn' is not defined.
I can't figure out how to overcome this.
I am also new to python...So ...
2
votes
2answers
812 views
python mysql database connection error
I am trying to access the remote database from one Linux server to another which is connected via LAN.
but it is not working.. after some time it will generate an error
`_mysql_exceptions....
0
votes
1answer
7k views
MySQLdb: how to connect with phpMyAdmin
I have a LAMP server and then I installed MySQLdb for my Python scripts. Now I can't access the MySQL (from LAMP) from Python scripts because it isn't connecting to the MySQLdb, and also I can't ...
1
vote
2answers
547 views
Two connections/cursors in mysqldb - commands out of sync error
I'm using mysqldb in part of a script to copy information from one database to another. A snippet of the code I have is as follows:
connection1 = mysqldb.connect('localhost', 'root', 'password', '...
0
votes
1answer
28 views
musqldb-python doesnt really update the original database
I used mysqldb to connect to a database in my localhost.
It works, but if I add data to a table in the database when the program is running, it shows that it has been added, but when I check the ...
3
votes
1answer
2k views
ImportError: No localization support for language 'eng' in python
i am getting ImportError: No localization support for language 'eng' when using MySQL Connector Python.
My Traceback is as below.
Traceback (most recent call last):
File \"DB_Module.py\", line 151, ...
2
votes
0answers
1k views
Python MySQLdb connection - when to open/close new connections?
I'm using a few apps running Tornado Web server which all connect to a MySql DB using mysqldb. When I spin up the server, it instantiates a DB class (below) which opens a connection to the DB. All ...
8
votes
3answers
16k views
Update database with multiple SQL Statments
I am using mysql connector.Python 1.0.9 downloaded from MySQL site.
I have a sample table here
DROP TABLE IF EXISTS my_table;
CREATE TABLE my_table
(id INT NOT NULL AUTO_INCREMENT UNIQUE,
Shot ...
2
votes
2answers
2k views
MySQL in Python; connection closes in for loop after first cycle
My MySQL connection closes after one loop cycle. I probably do something wrong in the usage of the mysql object. It outputs one cycle and then exits with an error.
This is my code:
cnx = mysql....
1
vote
2answers
10k views
“Can't connect to MySQL server on 'localhost' (10061)” error in python
Just today I have decided that I wanted to learn python because I personally like the syntax and its feel. I am a pretty young developer and I really wanted to learn a new programming language since I ...
8
votes
2answers
13k views
MySQLdb with multiple transaction per connection
Is it okay to use a single MySQLdb connection for multiple transactions without closing the connection between them? In other words, something like this:
conn = MySQLdb.connect(host="1.2.3.4", port=...
1
vote
2answers
2k views
Python MySQL connection argument error
I am trying to write a simple program to connect MySQL and perform some operations
host = '10.0.106.40'
user = 'ddddd'
port = 3306
passwd = 'DDDDDD'
db = 'bbbbbbb'
''' Creates a MySQL connection and ...
2
votes
1answer
2k views
How to access a database in Django but without ORM support
I have a second database in my Django application, which is filled with static data about the equivalent of zipcodes in my country (Brazil) and the related streets, neighborhoods, cities and states.
...
5
votes
3answers
5k views
set up a MySQLdb connection object for multiple databases
This question is likely noobish.
Instead of hardcoding the MySQLdb connection object: e.g,
db = MySQLdb.connect('localhost','name','pwrd','db_name')
How do I set it up so I can specify the db_name (...
1
vote
3answers
5k views
Python and MySQL connection problems (mysqldb api)
I have config.ini:
[mysql]
host=localhost
port=3306
user=root
passwd=abcdefgh
db=testdb
unix_socket=/opt/lampp/var/mysql/mysql.sock
I have this class:
#!/usr/bin/python
import MySQLdb,ConfigParser
...