Tagged Questions

2
votes
0answers
30 views

Django model: creating small value fixed point

Summary I'm building a project in Django - and will many small-range positive decimal values (1.25, 0.01, etc). In the database (MySQL), it makes sense to store them as value*10^precision. This means ...
0
votes
2answers
34 views

(2002, “Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)”)

I am running a django based web application with apache. I am able to connecto to mysql from python and linux shell but, when i run the server i am getting the following error. Where am i doing wrong? ...
0
votes
1answer
32 views

MySql connector dies in Python

I have a problem in iterating over my cursor in MySQL 1.0.7 connector for Python 3.23. Unless print() the result of each iteration (which is both silly and time consuming) I get the following error ...
0
votes
1answer
29 views

Install mysql-python return error in CentOs

I want to run a django project on CentOs. I tried to install mysql-python by easy_install and pip but I got error with both of them. I Googled the problem and found some suggestions, but none of them ...
4
votes
1answer
49 views

Adding url to mysql row in python

I am trying to add a url to a text row in mysql using python and the MySQLdb library, but when I run my code it says there is an error in my sql syntax. Can you tell me what im doing wrong? Here is ...
0
votes
1answer
21 views

how do I get momoko working?

I am new to python and even newer to tornado/momoko. I am struggling with an example from momoko's website. I have the database.cfg file configured with my settings. #!/usr/bin/env python import ...
1
vote
1answer
26 views

Error When calling stored procedure in python - Using MySQLdb

I have a MySQL stored procedure called test which accepts one argument. I can execute the stored procedure from python 2.7x using below code data='Teststr' cur = db.cursor() cur.execute("CALL ...
1
vote
1answer
20 views

MySQLdb Python prevent duplicate and optimize muliple inserts

I wrote this python script to import a specific xls file into mysql. It works fine but if it's run twice on the same data it will create duplicate entries. I'm pretty sure I need to use MySQL JOIN but ...
0
votes
2answers
44 views

SQL multiple inserts with Python

UPDATE After passing execute() a list of rows as per Nathan's suggestion, below, the code executes further but still gets stuck on the execute function. The error message reads: query = query % ...
1
vote
1answer
28 views

Wrestling with Python MySQLdb timedelta

I'm converting a PHP program to Python. Apparently MySQLdb returns MySQL time fields as time deltas offset from midnight. So a database field containing a literal "08:00:00" (8:00 AM) is returned as ...
2
votes
0answers
102 views

How to connect with passwords that contains characters like “$” or “@”?

I cannot get a connection to a MySQL database if my password contains punctuation characters in particular $ or @. I have tried to escape the characters, by doubling the $$ etc. but no joy. I have ...
0
votes
1answer
50 views

MySQL connector

I am trying to build a tool that one step of it is connecting to MySQL database. Just I am so confused about ODBC. If I want to build a cross platform connector by python, should I use python ...
0
votes
2answers
53 views

Automatically create MySQL table from input/file [closed]

Possible Duplicate: Generate table schema inspecting Excel(CSV) and import data I'm working on a tool to automatically create a MySQL table based on input. For example. input ...
2
votes
1answer
44 views

Deleting lines in mysql through python

I am trying to write a table in mysql through python: I want to make table in MYSQL but delete the lines that are more than 3, in other words I just want 3 lines. for example emp_no Num1 Num2 ...
0
votes
4answers
52 views

Connect on remote MySQL database through Python

I have tried the following script but unfortunately doesn't work. I am using a free MySQL database provider. Any ideas? import MySQLdb myDB = ...

1 2 3 4 5 123
15 30 50 per page