Tagged Questions
-1
votes
2answers
49 views
creating database in python
I have installed mysql for python and running python from command line. I am getting syntax error while creating a database.
>>> import MySQLdb
>>> CREATE DATABASE chom;
File ...
1
vote
2answers
55 views
Filter mySQL data while using fetchall(), before passing rows into Excel, via DataNitro
I am trying to simplify this so it will pull any data and lay out without any conflict, but I find errors if I have a date structure with colons and if some of my products have uses of backslash or ...
0
votes
1answer
39 views
Python MySQL Update taking 10-12 seconds to update about 1000 records
I have something along the lines of:
while True:
variables are set - Each loop the variables are different.
sql = sql statement with above variables
send sql to MySQL server
I am able ...
-1
votes
1answer
40 views
Installed new version of python, Now I can't use the libraries I've installed for the older version in Mac
I am using an older version of Python 2.7.3, but I realize that it is a 32 bit version and I needed a 64 bit version to be able to use MySQLdb.
Also, I have other libraries that I have downloaded for ...
0
votes
1answer
23 views
Python-MySQLdb: Difficulty In Creating Table
I am facing a problem while creating a table in mysqldb using python like this:
cursor.execute("CREATE TABLE IF NOT EXISTS %s ( tweetId VARCHAR(100) NOT NULL, tweet VARCHAR(180) NOT NULL, PRIMARY ...
0
votes
1answer
36 views
Python [ mod_wsgi ] how to gather up all of the mysql results into an array?
via cli:
[root@localhost 0]# python test13.wsgi
(1, 'aaaaaa')
(2, 'sdsdfsdfsd')
(3, 'dsfsdfasdfsdf')
(4, 'sdgsdgsdfsa')
[root@localhost 0]#
via apache :
(4, 'sdgsdgsdfsa')
script code:
import ...
-1
votes
1answer
26 views
Python [ mod_wsgi ] works via cli but not via apache
cli:
[root@localhost 0]# python test13.wsgi
(1, 'aaaaaa')
[root@localhost 0]#
apache:
Internal Server Error
full script code:
import MySQLdb
conn = MySQLdb.connect (host = "localhost",
...
0
votes
1answer
58 views
Error “TypeError: not all arguments converted during string formatting” MySQLdb
I am trying to update a MySQL table through Python 2.7. I have read and tried many solutions and keep getting an error message: TypeError: not all arguments converted during string formatting
import ...
2
votes
1answer
82 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 ...
5
votes
1answer
1k 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
0answers
65 views
How can I extract columns of two different tables in SQL format in a same time and put them together in Python with mySQLdb?
I have a database consists of several tables in SQL format. I want to write a python code with MySQLdb module, to extract a column from one table and another from the other one and fetch them ...
0
votes
2answers
45 views
Returning elements from lists within a list
I am trying to select the first element from nested lists within a bigger list. I am trying to return name values out of a MySQL table. I establish a connection to the server and then I do the ...
1
vote
1answer
61 views
Python MySQLdb not inserting data
ubuntu version: 12.10
mysql server version: 5.5.29-0
python version: 2.7
I am trying to use MySQLdb to insert data into my localhost mysql server. I don't get any errors when I run the script but ...
0
votes
1answer
105 views
SQL query embedded in python script - ERROR
I wanted a script that iterates through csv files in a folder and dump them into a MySQL database. I was able to dump one csv file into it.. But have troubles passing the file name in to the SQL ...
1
vote
1answer
106 views
Retrieving New Rows of MySQL Database without Restarting App in Python
I created a chat app in PHP using jQuery/AJAX. And now I'm trying to create a Python (2.7.3) app with GUI (Tkinter) that will be used to view and administer chats.
I have a MySQL database that stores ...
0
votes
2answers
121 views
MySQL in Python; connection closes in for loop after first cycle
My MySQL connection closes after one loop cycle. I probably do something wrong in the usage of the mysql object. It outputs one cycle and then exits with an error.
This is my code:
cnx = ...
0
votes
2answers
115 views
Error in installed MySQL-python-1.2.4b4 on fedora 17 [closed]
Hello I am trying to install python on my fedora 17 with python version 2.7.3 using these commands ....
gunzip MySQL-python-1.2.4b4.tar.gz
tar -xvf MySQL-python-1.2.4b4.tar
$ cd ...
1
vote
2answers
191 views
Python 2.7.1, codecs, and MySQLdb; why is setting file encoding not needed
I have a small Python program that reads in SQL statements from a file and runs them on a MySQL database. The file is encoded in UTF-8 and the database also uses UTF-8.
If I don't set the database ...
0
votes
1answer
222 views
Can't import MySQLdb module in Python
I'm trying to use MySQL in Python. I have installed the MySQL adapter (MySQL-python-1.2.4b4.win32-py2.7) for Python, but when I try to import the MySQLdb module (import MySQLdb) with command prompt I ...
0
votes
1answer
321 views
debian: mysql-workbench installation error [cannot find -lpython2.7.a]
I'm trying to install mysql-workbench-gpl-5.2.45 from the source code on Linux debian 2.6.32-5-amd64. The problem appears at the "make" step with error message:
/usr/bin/ld: cannot find -lpython2.7.a
...
0
votes
0answers
55 views
Exporting from python to MySQL
I recently learned how to scrape data with python, now I want to export this data directly to a MySQL database or make one in python. This is a part of the scraper I've done.
URL = ...
1
vote
2answers
142 views
string decode method error in python
I have a function like this:
def convert_to_unicode(data):
row = {}
if data == None:
return data
try:
for key, val in data.items():
if isinstance(val, str):
...
0
votes
1answer
43 views
python-mysql fetchone() type mismatch?
I have this piece of code that should return the value of the password from the db and match it with the password entered. I appended the characters on this line to match the formatting of the result ...
0
votes
1answer
125 views
MySql Database connection with python
I've got an issue trying to connect to a database with python. It compiles without error but it doesn't seem to do anything. I'm not sure if I'm instantiating the class incorrectly or what the issue ...
0
votes
2answers
324 views
Closing cursor and connection with Python and MySQLdb
I have a simple web.py-based app that uses MySQLdb. I have a class that handles database operations like so:
class db():
def __init__(self):
db = MySQLdb.connect(host='mysql.server', ...
1
vote
0answers
129 views
Copy unicode data from MSSql to MySql in Python error
I am trying to copy unicode data from MSSql to MySql. Below is the code that I am trying for past few days, but unable to do it successfully.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb
...
0
votes
1answer
317 views
Python Singleton class to handle “MySQL server has gone away” error
When I was trying to execute a query -
select * from students where id = 20
using Python's MySQLdb library, I was getting an exception: _mysql_exceptions.OperationalError saying MySQL server has ...
1
vote
0answers
125 views
How to connect MAMP based MYSQL in Python?
I recently upgraded Python on my Macbook to 2.7 via Macport and eventually I had to upgrade MySQL driver too. I tried to install it via Macport but that guy installed another copy of MySQL server too. ...
1
vote
1answer
251 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 ...
0
votes
1answer
110 views
ProgrammingError in inserting blob object in MySql using Python
I have a MySQL database and a table with the schema
tweet_id BIGINT
tweet_metadata LONGBLOB
I am trying to insert a row into my database as follows :
import MySQLdb as mysql
host = 'localhost'
...