473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MySQLdb installed, won't connect on OSX

Greetings,

I am attempting to get MySQLdb 0.9.2 installed on Mac OS 10.2 with a
Fink distribution of Python 2.2.2. I have seen only a few posts on the
subject, some of them relate to "conflicting header files," but I don't
know what to do about conflicting header files, or where I would find
them, and once I found them, which ones to remove.

I have compiled MySQL 4.1 and installed into /usr/local/mysql, but
since have moved to a Fink package installation or 4.0.13. Although
MySQLdb appears to install successfully (I think), I am unable to
connect when I try, as shown below:
import sys
import MySQLdb
conn = MySQLdb.connect (db = 'mydb', host = 'localhost', user = 'myuser', passwd = 'mypassword')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/sw/lib/python2.2/site-packages/MySQLdb/__init__.py", line 63,
in Connect
return apply(Connection, args, kwargs)
File "/sw/lib/python2.2/site-packages/MySQLdb/connections.py", line
116, in __init__
self.converter[types.StringType] = self.string_literal
TypeError: object does not support item assignment


My setup.py file contains the following (although I've tried many
variations, commenting and uncommenting stuff with no real success):

# include files and library locations should cover most platforms
include_dirs = [
# '/usr/include/mysql',
# '/usr/local/include/mysql',
# '/usr/local/mysql/include/mysql',
'/sw/include/mysql'
]
library_dirs = [
# '/usr/lib/mysql',
# '/usr/local/lib/mysql',
# '/usr/local/mysql/lib/mysql',
'/sw/lib/mysql', '/sw/lib'
]

This is what happens when I build:

running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
skipping '_mysql' extension (up-to-date)

And when I run setup.py install:

running install
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
skipping '_mysql' extension (up-to-date)
running install_lib
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/_mysql.so (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/_mysql_exceptions.py (output
up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/CompatMysqldb.py
(output up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/__init__.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/connections.py (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/__init__.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/CLIENT.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/CR.py (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/ER.py (output
up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/FIELD_TYPE.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/FLAG.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/constants/REFRESH.py
(output up-to-date)
not copying
build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/converters.py (output
up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/cursors.py
(output up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/sets.py
(output up-to-date)
not copying build/lib.darwin-6.6-PowerMacintosh-2.2/MySQLdb/times.py
(output up-to-date)
skipping byte-compilation of
/sw/lib/python2.2/site-packages/_mysql_exceptions.py to
_mysql_exceptions.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/CompatMysqldb.py to CompatMysqldb.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/__init__.py to __init__.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/connections.py to
connections.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/__init__.py to
__init__.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/CLIENT.py to
CLIENT.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/CR.py to CR.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/ER.py to ER.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/FIELD_TYPE.py to
FIELD_TYPE.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/FLAG.py to FLAG.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/constants/REFRESH.py to
REFRESH.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/converters.py to converters.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/cursors.py to cursors.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/sets.py to sets.pyc
skipping byte-compilation of
/sw/lib/python2.2/site-packages/MySQLdb/times.py to times.pyc
Any help would be greatly appreciated.

Thanks,

Peter
Jul 18 '05 #1
1 2564
Peter Nikolaidis fed this fish to the penguins on Thursday 25 September
2003 05:05 am:
This is what happens when I build:

running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
skipping '_mysql' extension (up-to-date)

And when I run setup.py install:

running install
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
<snip>

Well, my first thoughts would be to remove the destinations files, so
that the build/install doesn't find "up-to-date" versions of files...
Then force a build of everything...
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Derek Fountain | last post by:
I was trying to use MySQLdb to connect to a database. All is OK, except I can't figure out how to get the details of an error. Suppose I try to connect to a non existant server, or with the wrong...
2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
2
by: Daniel Baggott | last post by:
Hi, I'm seeking assistance in troubleshooting connecting to MySQL (4.0.20) using Python (2.3.4) and MySQLdb (1.0.0). When I attempt to make a connection, I get the following exception:...
2
by: ws Wang | last post by:
MySQLdb is working fine at command line, however when I tried to use it with mod_python, it give me a "server not initialized" error. This is working fine: ----------------------- testmy.py...
4
by: fedor | last post by:
Hi all, I have a problem with mysql connections. After about 28000-29000 connections, I get a "Can't connect to MySQL server on '127.0.0.1'" error. I have made a small program which generates...
2
by: Mondal | last post by:
Hi, I am using MySQL 5.0 beta and Active Python 2.4. I have the correct version of MySQLdb installed. The problem is that I can't connect to MySQL through the Active Python interactive window. ...
1
by: shearichard | last post by:
Hi - I have written some python to insert a row into a table using MySQLDB. I have never before written SQL/Python using embedded parameters in the SQL and I'm having some difficulties. Could...
1
by: Grzegorz Smith | last post by:
Hi all. I'm trying get data from text field in MySQl 5.0 with my National characters. Data are stored in utf8 encodings. Here is the script: import MySQLdb, MySQLdb.cursors conn =...
1
by: Jia Lu | last post by:
Hi all. I am using a hosting space with python cgi. But this host haven't got MySQLdb installed. Is there any methods to connect to Mysql without MySQLdb. Or any other DB methods with original...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.