Tagged Questions
1
vote
0answers
26 views
MySQL Connector/Python stored procedure insert not committing
I'm writing a python script to monitor a few 1wire sensors off of a Raspberry Pi and store the results in a MySQL database.
Using the MySQL Connector/Python library I can successfully connect to the ...
0
votes
1answer
23 views
MySQLdb return `Decimal` for a `sum` of `INT`
This is the table definition I use to reproduce the issue:
create table test_sum_type
(
kind char(1) not null,
n tinyint not null
);
Test data:
+------+---+ ...
0
votes
2answers
38 views
Where to begin with saving user input in Python
I am building a basic app in python in which the user inputs data being used for the task. I found how to write to a table using mysql, but I'm not sure if that's what I want. I'd like them to be ...
0
votes
0answers
19 views
Databug I need to program arround
I have solar panels from which I log the data into a mysql db, due to a bug in the inverter the first few entries are from the day before and at some point the inverter reset and the actual values are ...
0
votes
1answer
10 views
Configuring MySQL with python on OS X lion
MySQL is installed at /usr/local/mysql
In site.cfg the path for mysql_config is /usr/local/mysql/bin/mysql_config
but when i try to build in the terminal im getting this error:
...
0
votes
0answers
38 views
Error while using the id of one record in another record
models.py
from django.db import models
import datetime
class Categories(models.Model):
category_name=models.CharField(max_length=200)
def __unicode__(self):
return ...
0
votes
1answer
21 views
Python MySQLdb String Replacement
I am trying to figure out why my mysql insert statement doesn't seem to work with string replacement. Simple example.
#!/usr/bin/python
import MySQLdb
db = MySQLdb.connect(host="localhost", ...
-3
votes
0answers
20 views
How to group rows in mysql and then iterate through those rows in python?
I have a table in the form of:
user_id col1 col2 event_id
What I would like to do is to group rows based on event_id and then iterate over those rows.
For e.g if we have data like:
1 abc xyz 10
2 ...
8
votes
1answer
60 views
What python 3 library should I use for MySQL?
As far as I know MySQLdb still isn't ported to Python 3.
There seems to be another library called PyMySQL on pypy but the installation for python 3 looks strange (run a .sh script?). Also there is a ...
0
votes
1answer
24 views
Insert list with several items into mysql database
I have a list like this:
list = [('name1', 'id1', 'created_at1'),('name2', 'id2', 'created_at2'),('name3', 'id3', 'created_at3')]
And I want to put it into a Mysql Database using MySQLdb that it ...
1
vote
2answers
25 views
Python lists into MySQL Database
I have a question and I am actually already struggling with the approach how to tackle it.
I have several lists.
name = ['name1','name2', 'name3']
id = ['id1', 'id2', 'id3']
created_at = ...
0
votes
1answer
21 views
Openshift-django-mysql : No tables created to database via syncdb
My settings.py
if ON_OPENSHIFT:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django',
'USER': 'USER',
...
1
vote
0answers
33 views
Django Unknown system variable 'TRANSACTION' on syncdb
My local Django is blowing up running the manage.py syncdb script that runs on our servers.
This is the error message I'm seeing when running python manage.py syncdb,
OperationalError: (1193, ...
1
vote
1answer
29 views
Asynchronous database inserts - python + mysql
I am making a utility in which I need to extract tweets for a user and store them in database. Twitter API only sends 20 tweets in one call and to retrieve more tweets, you need to page through the ...
1
vote
0answers
50 views
MySQL split string on pattern
I have a colum named data, which have string values in different formats like:
55,'first_name','2394234'
'first_name', '2394234'
'124', 'first_name', '2394234'
I need to extract substring ...