Tagged Questions
0
votes
1answer
47 views
Python - can't connect to databse
I'm learning python , I'm trying to connect to database:
OS Ubuntu 13.04
I have running the apache and localhost
Im using eclipse pydev
I have installed the mysql connector downloaded from ...
0
votes
1answer
21 views
MYSQL Datetime, remove seconds
I've been attempting to do this for quite sometime.
I have a program which periodically writes rows to a table.
(table1)
ID Date Text Number
The Date column is in format yyyy-mm-dd hh:mm:ss ...
0
votes
0answers
19 views
MongoDB connection handling [on hold]
I am developing a web scraping project on Ubuntu 12.04 box. I am using Scrapy, Python, MongoDB, Pymongo, Mysql, MySQLDb.
In this project i have four spiders i.e spider1, spider2, spider3, spider4 ...
1
vote
1answer
20 views
Elastic Beanstalk not creating RDS Parameters
I'm following this tutorial in an effort to create a Django application on AWS.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html
I was able to get everything ...
0
votes
1answer
18 views
How can I use Python namedtuples to insert rows into mySQL database
I have used namedtuples to read rows from mySQL ... it is great. Can I use the same mechanism to INSERT rows into mySQL.
My system is changing quite a bit, so I need an simple way to map python values ...
0
votes
0answers
78 views
can I join in raw numbers to a sql query?
This is sort of a weird question, so I don't really know how to phrase it or begin searching for answers. Sorry for wall of text.
The situation (which is unfortunately complicated enough to start ...
0
votes
0answers
32 views
OperationalError: (2002, “Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)”)
when connecting to mysql database in Django ,I get the error.
1.I'm sure mysql server is running.
2./var/run/mysqld/mysqld.sock doesn't exist.
3.When I run $ find / -name *.sock -type s, I only get ...
1
vote
1answer
24 views
Replicating GROUP_CONCAT for pandas.DataFrame
I have a pandas DataFrame df:
+------+---------+
| team | user |
+------+---------+
| A | elmer |
| A | daffy |
| A | bugs |
| B | dawg |
| A | foghorn |
| ...
0
votes
1answer
13 views
python MySQLDb insert with prepared Statements
I have a table with fields
TABLE_PASTE(
user_text longtext NOT NULL,
number integer NOT NULL
)
I am trying to insert a row in this table TABLE_PASTE from python using MySQLDb driver.
...
0
votes
0answers
20 views
Does MySQLdb have an export SQL feature?
As ldif module for ldap, does MySQLdb handles exports like mysqldump does ?
I did not find any pure python solution, and the official module documentation makes no mention of it.
I can use ...
1
vote
0answers
22 views
mysql utilities - path setup
I'm using the MySQL Workbench CE 5.2.47 utilties, and I'm trying to get mysqldbexport to run from a directory other than where it's installed (in my case, D:\Programs\MySQL\MySQL Workbench CE ...
0
votes
0answers
25 views
use F to update multiple fields Python
HI i need to update the multiple fields in the database , right now i am updating like this
for t in getteamPlayers :
getmyplayer= myplayer.objects.get(id=t.playerId)
getPlayerAge = ...
0
votes
1answer
27 views
use F for referencing 2 tables to update python
HI i have a script which use 2 or 3 tables for referencing to update the data in database
below is the code
getteam = myteam.objects.only("id") # [:2] limits the query to 2 just for testing
for ...
0
votes
2answers
20 views
Do database access generators return new rows that are added while using them?
More specifically, if I iterate through a database using a python db api which emulates a generator giving me one row at a time, will the generator also return new rows that I create in the meantime?
...
3
votes
0answers
21 views
Threading and SQLAlchemy Sessions
I know this question has been asked a few times, but I'm still unsure about the usage of scoped_session with threading. Basically, I have an application with 10 worker threads. I have one Engine with ...
-2
votes
0answers
51 views
What type of database is most well-suited for storing a lot of real-world data acquired via python? [on hold]
I've got a setup that I use to acquire testing data via a serial port (force data, for what it's worth) and a camera. Currently, I am just keeping the data in memory as my tests are only a few minutes ...
0
votes
1answer
30 views
How can I reach one of results from database in Python
I'm trying to get some infos fro database in Python. Im new in it and I, unfortunatelly, wasted a lot of time for that. I expect that my problem is really simple.
I have sth like that to fetch data:
...
0
votes
1answer
23 views
which engine should use for gaming site with heavy traffic and updates and inserrtion [on hold]
Hi. I am developing a gaming site in which there will be a heavy updates and insertion regularly in the database.
Currently i am using the MyISAM engine and the speed of insertion and updates take ...
-2
votes
1answer
39 views
select particular field in python
Hi i need to fetch all rows for particular field from database right now i am using
mygame.objects.all()
which fetches all fields say
x ,y , z and so on
and so on but i need to select ...
2
votes
2answers
48 views
increase insertion speed in python
I have a script in django which i am running on terminal to update the field values in database ,
there is about 3000 records to be updated , it updated but it takes so much time.
Here is the code:
...
-1
votes
1answer
33 views
Inputing values into MySQL from Python
I have 2 questions:
I was trying to input values into a MySQL table, I kept on getting an error when I tried to input date type object in MySQL.
MySQL expects this;
Settlement DATE DEFAULT NULL
...
0
votes
1answer
17 views
MySQL table to Python list of lists using fetchall()
how can I transform this table:
ID ITEM_CODE
--------------------
1 1AB
1 22S
1 1AB
2 67R
2 225
3 YYF
3 1AB
3 ...
-1
votes
1answer
51 views
_mysql_exceptions.ProgrammingError: (1064, “You have an error in your SQ L syntax; right syntax to use near ')' at line 1”)
Python MySQL Statement returning Error
def _conditional_insert(self, tx, item):
tx.execute('select * from table where text1 = %s', (item['text1'], ))
result = tx.fetchone()
if result:
...
0
votes
1answer
24 views
IntegrityError #1062 in django.db.utils - Duplicate entry for key 2
Using Py2.6, FreeTDS to import data from a MSSQL database and drop into MySQL.
I have a table with a unique key that I think needs to be changed. It should not be unique, and is not the id key.
...
0
votes
3answers
28 views
update null field with integer in django Python
HI i have a field in database whose value is null = true but i need to update it timely with the integers .I am running this script on terminal
getW = get_HomeTeam_myworld.w
getL = ...
0
votes
1answer
28 views
importing timestamps + data from mysql to python and plotting time-series
I have a mysql table that I want to access and extract data from. The table is structured as seen here:
| Id | datestamp | timestamp | bloodSugar | carbohydrates | insuline |
| 1 | 2013-08-05 | ...
0
votes
3answers
50 views
Is there a simple method for executing command line statements, in windows, from within python?
I've searched high and low for a simple explanation of how to execute command line, in windows, from within python.
The subprocess package seems to be the answer, but I do not appear to be ...
0
votes
1answer
33 views
From MySQL table to Python list
I have this table in mysql, where I have the occurrences (CNT column) of each ITEM for each distinct ID:
ID ITEM CNT
---------------------
01 093 4
01 129F 2
01 AB56 ...
1
vote
1answer
19 views
Python and Mysql quotes and variables
I've run in to a problem i don't know how to solve.
I have this line:
parse = cur.execute("SELECT * FROM testdb WHERE Match(name) AGAINST ('"The.New.York.Times"' IN BOOLEAN MODE);")
If I ...
2
votes
2answers
73 views
Python SQLAlchemy - “MySQL server has gone away”
Lets have a look at the next snippet -
@event.listens_for(Pool, "checkout")
def check_connection(dbapi_con, con_record, con_proxy):
cursor = dbapi_con.cursor()
try:
cursor.execute("SELECT 1") ...