Tagged Questions
0
votes
0answers
9 views
Python and MYSQL have different encodings/charset
I have a large mysql database with the following charset variables:
character_set_client : cp850
character_set_connection : cp850
character_set_database : latin1
character_set_filesystem : ...
0
votes
1answer
30 views
How to download a file located in web server CGI-bin folder?
I am creating a web application via python cgi . then after execute the cgi script , sqlite and mysql database files buildup in cgi-bin folder. thus i want to grant download it for users. but cgi-bin ...
0
votes
1answer
13 views
Not getting proper character encoding with Facebook posts data
I'm trying to populate Facebook posts data from a particular page (here bestbuy), extracted via Graph API (https://github.com/pythonforfacebook/facebook-sdk), to mysql tables. I'm extracting posts as ...
0
votes
2answers
36 views
python inserting into mysql
I am trying to work out what is wrong with my code. I am trying to enter data into a mysql, and python doesn't seem to like how i have done something.
Test Data
Name = "TestRegion"
Perent= "perent"
...
0
votes
1answer
40 views
I want help python code to send sms to the numbers stored in mysql database
I have a table in a database with columns, dept name, name, id, date,day, time, mobile number.
Each column is having its own value.
I want to fetch the above data from the database and send an sms ...
1
vote
2answers
29 views
Unknown column on a Django fetched list
So I Have this Models that are generated from a MySQL base:
class Problem(models.Model):
idproblem = models.IntegerField(db_column='idProblem', primary_key=True)
iduser = ...
0
votes
2answers
24 views
Searching for abbreviated words in MySQL
I have a MySQL database, working with Python, with some entries for products such as Samsung Television, Samsung Galaxy Phone etc. Now, if a user searches for Samsung T.V or just T.V, is there any way ...
0
votes
1answer
11 views
How to execute simple command using mysql.connector (Python)
I installed the MySQL connector from Oracle, and entered the following commands in Python (currently running Python 2.7.6)
import mysql.connector
...
0
votes
1answer
17 views
_mysql_exceptions.ProgrammingError: closing a closed connection
I have a Python crawler which uses a MySQL database, currently working on localhost. This is the part of the code where data gets inserted in the database and where I open and close my database ...
1
vote
2answers
29 views
Python insert values <= 1e-7 in a MySQL database
I hava a python (2.7) function which performs a MySQL update query on a double value, when numbers are greater then 1e-7 everything works fine, the problem is that if the number is equal or smaller it ...
1
vote
1answer
28 views
How can I install Pythons MySQLdb module on openSUSE?
I currently have to install the Python package MySQLdb on a openSUSE 11.3 "Teal" that has Python 2.6.5.
Yes, I know that the current openSUSE is 13.1 and the last version that is supported is 11.4 ...
0
votes
0answers
14 views
Drupal - MySQL Error - Connection Attempt Failed
Hi I am load testing my website made from drupal... I am using pylot to do the loadtest. I use a client PC that connects to the server of my site to perform the test. got this error
[Errno 10060] A ...
0
votes
1answer
35 views
Data extraction and transform efficiency
I've got a Python script that connects to a MySQL database and executes a number of nested SELECT queries. It's basically a giant for loop. The database is structured such that Businesses have Menus, ...
0
votes
1answer
47 views
Go, Golang : fetchall for go MySQL?
I am using the go-mysql-driver https://github.com/go-sql-driver/mysql
I am looking for something like the following in Python:
c = conn.cursor()
c.execute(sql)
result = c.fetchall()
for elem in ...
0
votes
0answers
11 views
Got error -1 from storage engine (MYSQL 5.6)
Could please someone explain to me this mysql error which I am getting time to time.
(1030, 'Got error -1 from storage engine')
0
votes
0answers
17 views
Python - mysql - Google app engine: Runtime error
I just started developing python-google app engine apps on MacOS.
I keep getting a "ImportError: No module named mysql.connector" while trying to access a database during Runtime.
whats surprising ...
1
vote
1answer
22 views
MySQL and Python-Insertion
I am trying to insert some values into my table. The code is:
import MySQLdb
db=MySQLdb.connect(host="localhost",user="user_name", passwd="",db="name_of_db", port=3306)
cursor=db.cursor()
...
0
votes
1answer
27 views
My program isn't changing MySQL database yet presents no error
I've written a program to scrape a website for data, place it into several arrays, iterate through each array and place it in a query and then execute the query. The code looks like this:
for count ...
1
vote
0answers
15 views
MySQL Internal Error Ignored
I am receiving the following error:
Exception mysql.connector.errors.InternalError: InternalError() in <generator object sql_iter at 0x10efe84b0> ignored
When I try to iterate through:
...
1
vote
1answer
33 views
Accessing data through OnetoOne key in django
I have two models connected using a OnetoOne Model key.
class Job_expectation(models.Model):
SLAB_CHOICES = (
('H', 'Hourly'),
('W', 'Weekly'),
('M', 'Monthly'),
)
...
1
vote
1answer
35 views
How to capture user input from Bash prompt with Python
I am running mysql_secure_installation which prompts the user for the root database password and asks the user to enter Yes or No to some other initial setup options. How would I capture the root ...
0
votes
2answers
20 views
Python MySQL insert and retrieve a list in Blob
I'm trying to insert a list of element into a MySQL database (into a Blob column). This is an example of my code is:
myList = [1345,22,3,4,5]
myListString = str(myList)
myQuery = 'INSERT INTO table ...
1
vote
0answers
16 views
SQLalchemy: alembic bulk_insert() fails
Before you flag this as a duplicate:
I did take a look at this question/answer, and I did do what it suggests, but when I do add this code:
permslookup = sa.Table('permslookup',
...
0
votes
2answers
44 views
Reading a CSV and writing to a database with Python
I'm brand new to Python, but have a history with R. I've been tasked to read a CSV file and upload it's contents to a database upon completion of a process on a Windows application. Basically, the ...
0
votes
1answer
36 views
WordPress not running in local environment, developed for Google app engine
I have installed the WordPress, MySQL,PHP SDK on Linux (Ubuntu 13.10) and configure everything according to google-appengine-help-page
But, I can't access the wordpress in local environment also ...
0
votes
0answers
18 views
How to work with relational Sqlite and MySQL databases in python
I have two sqlite,MySQL databases .these databases connected by primary and foreign keys. but i don't know how they use as relational databases in python. i know how to use an one sqlite,MySQL ...
0
votes
1answer
57 views
Spider not returning all results after changing my item pipelines to an if and elif statement
If you look here I could not get two different spiders to automatically add the results to a mysql database. Now I've added an if and elif statement and they work but they miss out some results, ...
-1
votes
0answers
22 views
insert to mysql from multi line string
I have the string below and I would like to insert into a Mysql Database. The database is configured with the table and fields already.
from the string below each line is a field name: data pair . ...
-2
votes
1answer
14 views
Remote database connection using Python
I have a Python programm which is scraping some values from my localhost. My aim is to store that values and to insert them into my live Website. To be more specific, i would like to insert those ...
1
vote
1answer
20 views
Does the Storm or SQLAlchemy ORM allow creating schema's from an existing database?
Considering Storm, a python ORM, I would like to automatically generate the schema for a (mysql) database. The home page states
"Storm works well with existing database schemas." ( ...
0
votes
1answer
20 views
Using an SQL expression to insert data with SQLAlchemy (and MySQL)
I would like to be able to insert data into a MySQL database and have one or more of those columns the result of a MySQL function. For instance:
CREATE TABLE values (a varchar(255), b int, c date);
...
0
votes
0answers
16 views
python database cursor does not see changes in database
I am fetching rows from MySQL table by calling my method get_data(), see code below.
I am using python mysq.connect driver
In parallel database session I am inserting rows in the same table and I ...
0
votes
1answer
15 views
Force strict sql mode in django
I'm trying to force my django project to always use strict sql_mode. Is there another way than putting the following in manage.py? It seems overly complicated.
def set_strict_sql_mode(sender, ...
0
votes
0answers
29 views
How can i find the compatible databases for python 2.2
For some weird reason one of our app run in python 2.2 and no way we can upgrade it.
So i have to run a script to export data from that app using python 2.2 .
Is there any way i can find which ...
1
vote
1answer
23 views
Float Values Rounding with SQLAlchemy and MySQL
My question is similar to this unanswered question: SQLAlchemy commits makes float to be rounded
I have a text file of data that looks like this:
#file camera date mjd focus error
ibcy02blq UVIS1 ...
0
votes
1answer
17 views
Flask-SQLAlchemy declarative and MySQL specific data types
I have an already existing MySQL DB with many columns defined with MySQL specific column types (MEDIUMINT, TINYINT to mention a few), and even if the column type belongs to a standard SQL data type, ...
0
votes
1answer
33 views
mysqldb how to connect with phpmyadmin
I have a lamp server and then I installed mySqldb for my pyhton scripts. Now I can't access to the mysql(from lamp) from python scrip, because it connecting to the mysqldb and also I can't access to ...
1
vote
1answer
14 views
Read in Python with csv.reader a file with two different delimiter in the same file
I want to import a file from MySQL to python but there are two type of delimiters in the same file, on the same line.
For example:
FIELDA_FIELDB_FIELDC; FILEDD; FIELDE; FIELDF
I can split with _ ...
0
votes
1answer
18 views
MySQL spatial index with sqlalchemy?
There is a nice example in sqlalchemy docs on how to define and use Geometry column in sqlalchemy:
http://docs.sqlalchemy.org/en/rel_0_9/core/types.html#applying-sql-level-bind-result-processing
...
0
votes
0answers
18 views
mysql and python error with columns
I am running mysql on python 3.3 and when a bunch of requests come in at the same time it updates all rows of the table to that value instead of just where the where clause says
The part of the code ...
3
votes
1answer
26 views
Python TypeError - MySQL executemany
I am using the MySQLdb module to insert into my database. I have the following code
sqlString = """INSERT INTO PERFORMER (PERFORMER)
VALUES (%s)
WHERE ...
1
vote
0answers
30 views
I'm trying to store more than one spider's results into seperate tables in MySQL
Here is my pipelines.py. I have two spiders one called bristol.py and one bath.py. When I run 'scrapy crawl bristol' it automatically adds the results to my MySQL database tabled called 'Bristol'. I ...
0
votes
1answer
17 views
Using MySQL python module to Insert or update if row exists
I am using MySql and python MySQLdb module. I want to insert a new row or update certain fields if the row already exists.
The list of tuples that contains the values to be entered looks like this;
...
0
votes
0answers
14 views
dhtmlxScheduler recurring events query sql server side for todays events
I am currently trying make an application that allow a user to enter in appointments using dhtmlxScheduler (WITH recurring events) and I am saving the the output of the scheduler to my SQL server.
I ...
0
votes
2answers
47 views
How to debug C compiler errors in Python? (malloc error)
I am doing web development using Cherrypy in Python.
I had a working web page that did not have errors, but after I started using Mako for the front-end codes to parametrize it, the following error ...
0
votes
1answer
11 views
How to get selected item in table using pyqt?
I display data in a table from mysql database,
after that i want to when the rows in the table is clicked it will print the value in the line,that in print id existing data in the database. how do I ...
1
vote
1answer
28 views
How can I query on MySQL data snapshot using Python?
I'd like to create a snapshot of a database periodically, and execute some queries on the snapshot data to generate data for next step. Finally I want to discard the snapshot.
I read and convert all ...
0
votes
1answer
21 views
Create MySQL view with an extra calculated field in table
I am using python and MySQLdb module. I have a table that looks like this;
TableA
------
id
latest_time_seen
The format of latest_time_seen is 2014-02-05 00:00:50
From TableA, I would like to ...
1
vote
1answer
18 views
Inserting python variables into MySQL syntax problems
Can someone tell me what's wrong with this Syntax?
>>>y = 14
>>> cursor.execute("INSERT INTO accounts VALUES ('Bobby', %s)", (y))
Traceback (most recent call last):
File ...
1
vote
1answer
28 views
mysql_config not found when installing mysqldb python interface for mariadb 10 Ubuntu 13.10
After I installed Mariadb 10 the Mysql workbench and JPDB client both connect and work fine so next step was get programming with Python (using SQLAlchemy) which seems to require MySQL-python so I ...