A thread-compatible interface to the popular MySQL database server that provides the Python database API.
0
votes
0answers
35 views
insert a Python list into a column in MySQL
I have list and I want to enter each element of that list into associated indexed cells of a column in MYSQL using Python.
E.g
lst = [11,22,33,44,55,66]
MYSql column:
Data
11
22
33
44
55
66.
...
0
votes
1answer
33 views
How do I remove a python egg?
This post (How to install MySQLdb (Python data access library to MySQL) on Mac OS X?) recommends cleaning up a MySQLdb installation by removing a python egg:
"Step 3c: Remove the egg under ...
2
votes
1answer
24 views
Django - Can we make a connection to different remote database
I am writing a Django application where I already have 1 mysql backend db configured in my settings.py.
I know we can add as many db configurations as we want, but that's hard coding which I don't ...
0
votes
1answer
32 views
Python: MySQL connection is open, but can't create cursor
I'm trying to open a cursor to a MySQL-DB. But I'm getting this error:
'NoneType' object has no attribute 'cursor'
Here is a small sourcecode:
class Sample:
def __init__(self):
self.conn = ...
0
votes
1answer
23 views
ON DUPLICATE KEY UPDATE with a WHERE and COUNT condition…?
I would have liked to use a WHERE statement on a ON DUPLICATE KEY UPDATE statement in MySQL, however I understand you can't do this. I wanted my statement to be something like this..
INSERT INTO ...
1
vote
1answer
27 views
Trouble building mysql-python on dotcloud: needs distribute >= 0.6.28
I'm suddenly having trouble building my Python/Django app on dotcloud. It seems that MySQL-python needs distribute >= 0.6.28. My requirements.txt specifies distribute==0.6.36, but this is being ...
0
votes
2answers
33 views
SQL query to show results + or - 30mins than what is stored in table Python
I'm new to Python and using MySqldb and in need of a bit of help. I have the below code in a python script to search a table in my database to find any ids of meetings that have today's date. ...
1
vote
1answer
36 views
How to print standard/native MySQL output on the screen?
As per the title say: Is there a way to print standard/native MySQL output on the screen? I'm talking about, e.g. something like this:
san@pcjq:~$ mysql -uroot -p mysql -t -e "SELECT Host,User FROM ...
0
votes
1answer
20 views
Test connection to MySQL server
Whats the best / correct way to test a connection to a MySQL server.. can you for example ping it..? I'm using MySQLdb and python.
I want my program to be structured in the following way
...
2
votes
2answers
38 views
unable to access mysql database from python
I tried to access data from mysql database through python then I tried as
import MySQLdb
db = MySQLdb.connect(host = "127.0.0.1",
port = 3306,
...
3
votes
1answer
124 views
cc1: error: unrecognized command line option “-Wno-null-conversion” within installing python-mysql on mac 10.7.5
This error broke my python-mysql installation on Mac 10.7.5. Here are the steps
The installed python is 2.7.1, mysql is 64 bit for 5.6.11.
The being installed python-mysql is 1.2.4, also tried ...
0
votes
1answer
23 views
Generate SQL Insert statements for SQLite with Django
I want to generate a complete SQL file with Django that can be downloaded and executed to create a SQLite DB.
The problem is escaping the strings to insert them into the file to download. This is ...
0
votes
0answers
22 views
weakly-referenced object no longer exists error on creating a function
I am working with MySQL connector and Python 3.3. I am creating a script that consists of functions that frequently access database server. So for all the functions I have created, I am trying to ...
-4
votes
1answer
43 views
Cannot connect to WAMP server using Python script [closed]
I am tryin to connect to a mySQLdb using python and whenever i am trying to connect to it, it doesnt work. It works if i am tryin to connect to it using host as 'localhost' and port = 3306, username = ...
0
votes
1answer
96 views
ImportError: No module named MySQLdb - Debian 6.0
I got a problem in Python while try to import mysql. The beginning of my code is (I'm using monkeyrunner to run script) :
#!/usr/bin/env python
import sys
import MySQLdb
.
.
.
etc
Each time I ...