I sow post on
How to enable MySQL client auto re-connect with MySQLdb?
I had the same problem, I use pythonanywhere.com and when I write p.save() I had error like below.
It says something about updating mysql to fix it, but I don't know what code or shell commands I need to write.
Can you help me?
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py", line 545, in save
force_update=force_update, update_fields=update_fields)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py", line 570, in save_base
with transaction.commit_on_success_unless_managed(using=using, savepoint=False):
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/transaction.py", line 280, in __enter__
connection.set_autocommit(False)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 340, in set_autocommit
self._set_autocommit(autocommit)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 461, in _set_autocommit
self.connection.autocommit(autocommit)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 461, in _set_autocommit
self.connection.autocommit(autocommit)
File "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 243, in autocommit
_mysql.connection.autocommit(self, on)
OperationalError: (2006, 'MySQL server has gone away')
Your connection to the database was closed because it was idle for too long. From the traceback, it looks like you were doing your queries interactively. If you know that you've been idle for more than about 5 min, you should do this:
from django.db import connection; connection.close()
I solved the problem inserting this code where the connection will need to be restored and refreshed:
try:
cursor = connections['default'].cursor()
db = cursor.db
assert issubclass(db.__class__, BaseDatabaseWrapper)
if db.connection is None or not db.is_usable():
db.close_if_unusable_or_obsolete()
with db.wrap_database_errors:
db.connect()
logger.info('Restoring the Mysql Connection')
except Exception as e:
logger.exception('DB Connection error')
Please notice that I use connections['default'] because I have multiple databases configured so you can set a specific connection, notice also that I use db.is_usable() so to call the .ping() to allow to restore a connection when is possible instead of always closing the connection.
Related
I'm trying to revive an undocumented python server at work and I'm running into an issue with a missing file. When attempting to connect to the SQL DB with the credentials I've provided, I run into the following error:
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection
self.connect()
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 197, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 233, in get_new_connection
return Database.connect(**conn_params)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/MySQLdb/__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 179, in __init__
super(Connection, self).__init__(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2059, 'Plugin http could not be loaded: /usr/lib/mysql/plugin/http.so: cannot open shared object file: No such file or directory')
Sure enough, there is no http.so file at that location, though there is a healthy bunch of others. I cannot find any documentation on why this may be or where I'm supposed to get it.
I'm using Arch Linux, and just installed from the AUR using sudo pacman -S mysql. This is just an alias for mariadb from what I can tell, but I don't think that's an issue.
Is this shared object something I can get somewhere? Not sure really what to do here.
Came across a thread for HeidiSQL, which from what I read is a MySQL admin tool of sorts. Anyways, a user had the same issue over there, and someone responded with this:
Just don't use any protocol prefix in the hostname, unless you know it's required and correct. In most cases there must be just the hostname or an ip address, without a protocol.
https://www.heidisql.com/forum.php?t=27104#p34471
Sure enough, I was using http:// in my hostname. Removing that works just fine, though isn't so much of a solution as a workaround.
Yesterday I deleted my db tables, cause I needed change latin1_swedish_ci to utf8_general_ci for have a polish words in my apps. After that i can't do full migrate my database, because I have problem like that:
(venv) C:\netbast\fastandbeauty\project>manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, comments, contenttypes, registration, sessions, social_django, user_content, user_profile
Running migrations:
Applying social_django.0005_auto_20160727_2333...Traceback (most recent call last):
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\mysql\base.py", line 101, in execute
return self.cursor.execute(query, args)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\connections.py", line 50, in defaulterrorhandler
raise errorvalue
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 247, in execute
res = self._query(query)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 411, in _query
rowcount = self._do_query(q)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 374, in _do_query
db.query(q)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\connections.py", line 292, in query
_mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1071, 'Specified key was too long; max key length is 1000 bytes')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\netbast\fastandbeauty\project\manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\core\management\__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\core\management\commands\migrate.py", line 204, in handle
fake_initial=fake_initial,
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\migrations\executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\migrations\executor.py", line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\migrations\executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\migrations\migration.py", line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\migrations\operations\models.py", line 536, in database_forwards
getattr(new_model._meta, self.option_name, set()),
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\base\schema.py", line 353, in alter_unique_together
self.execute(self._create_unique_sql(model, columns))
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\base\schema.py", line 120, in execute
cursor.execute(sql, params)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\utils.py", line 80, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\utils\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\django\db\backends\mysql\base.py", line 101, in execute
return self.cursor.execute(query, args)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\connections.py", line 50, in defaulterrorhandler
raise errorvalue
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 247, in execute
res = self._query(query)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 411, in _query
rowcount = self._do_query(q)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\cursors.py", line 374, in _do_query
db.query(q)
File "C:\netbast\fastandbeauty\venv\lib\site-packages\MySQLdb\connections.py", line 292, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 1000 bytes')
I don't know what can I do, because I'm apprentice. I found answers, but it didn't help me.
Sorry for my bad English.
PS. When I start server it runs, but social-django doesn't work. Only that app can't migrate.
All the best,
Dinson
Disclaimer: I'm not an expert on this subject, I'm just stating my current practise, and suggestion here is just a suggestion ultimately you've decide if you going to use it.
Let's try and solve the problem, in your terminal go and type:
mysql -u root
then after you enter mysql monitor, you check if your fastandbeauty database still exists by typing SHOW_DATABASE;
if the database is still there drop it with DROP DATABASE fastandbeauty;
and then recreate and create a new fresh database by typing CREATE SCHEMA fastandbeauty DEFAULT CHARACTER SET utf8, if everything is all right monitor should omit a message Query OK, 1 row affected (0.00 sec), after that you can type SHOW_DATABASE again and see if the database exists
leave mysql monitor by typing \q
then you can do python manage.py migrate
that should create a new fastandbeauty database and you can continue working on it.
Now some future reference:
I suggest you don't use your development database on local production so you don't encounter things like this where you need to manually create/delete your db.
So you can dump your data into a file, with that file you will store some of your data for local development. How to use it?
Well you could make new git branch and name it something like local-dev-task-12, so you will work on this branch in the future, then you can create new database for this branch only and call the database fast_and_beauty12, just do the steps that I've all ready explained but before migration, cd into the folder where you keep your dump file and to this first:
mysql -u root -p fast_and_beauty_12 < DumpFastAndBeauty.sql - this will dump your data into new and fresh fast_and_beauty_12 created database
go into your setting db file and change the database name to that new one you've create so fastandbeauty >> fast_and_beauty12 so you can use it
and then you go and do python manage migrate.py
With this you will have a fresh database for that git branch and you can work on your db with out worrying of doing harm to the dev database.
NOTE:
You will not commit your new migration files from that branch, because that will make things go bad, you will git stash. them for future work.
After you've stashed migrations files go back to setting.py and change that name of you local database to you development database name so fast_and_beauty12 to fastandbeauty, migrate new changes into the development branch and you can do
python manage.py migrate, so that should populate you development database with new data.
The idea of this is to have new working database every time you create new branch for local development, it is a bit confusing in the beginning but after some time you will understand it, and start doing it more often. Potentially you don't need to do this if you are not going to work on your database, but still I think it's a good practice.
I don't have problems right now. What can you do to fix it?
You need go to my.ini (conf files in your SQL) and change MYISAM
default_tmp_storage_engine=MYISAM
to
default-storage-engine=InnoDB
Thanks for help guys!
I have a django+mysql website on AWS.
Client send post request to website, then the website query the mysql database and return a json.
I am doing stress testing to it.
I send 300 post requests simultaneously to the website and get responses correctly.
But if I increase the number of post request to 400, it fails with following log.
Server side :
File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
self.finish_response()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
self.write(data)
File "/usr/lib/python2.7/wsgiref/handlers.py", line 212, in write
self.send_headers()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 270, in send_headers self.send_preamble()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 191, in send_preamble self._write('HTTP/%s %s\r\n' % (self.http_version,self.status))
File "/usr/lib/python2.7/wsgiref/handlers.py", line 391, in _write self.stdout.write(data)
File "/usr/lib/python2.7/socket.py", line 328, in write
self.flush()
File "/usr/lib/python2.7/socket.py", line 307, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 104] Connection reset by peer
Client side:
HTTPConnectionPool(host='mywebsite.com', port=3456): Max retries exceeded with url: /project/result.json (Caused by <class 'socket.error'>: [Errno 104] Connection reset by peer)
I have tuned the mysql configuration for higher max_connections and timeout but it doesn't work.
Can anyone help me to resolve the issue? Thanks.
I'm trying to install Tryton ERP with MySQL as the database. It's not quite clear what you are meant to do.
From the config documentation you simply supply the uri to the database under the [database] section:
[database]
uri = mysql://user:pass#localhost:3306
However running trytond -v -c /home/user/.config/tryton/3.8/tryton.conf does not seem to get it working. When trying to access the 127.0.0.1:8050 where I've got Tryton running, I simply get 127.0.0.1 - - [23/Nov/2015 16:55:10] code 404, message File not found
One would assume, Tryton either installs the database on its own or you need to create yourself somehow but I didn't see any documentation surrounding that.
I've also trying adding a database through the Tryton GUI, it encounters the following error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tryton/gui/window/dbcreate.py", line 65, in server_change
common.refresh_langlist(self.combo_language, host, port)
File "/usr/local/lib/python2.7/dist-packages/tryton/common/common.py", line 253, in refresh_langlist
lang_list = rpc.db_exec(host, port, 'list_lang')
File "/usr/local/lib/python2.7/dist-packages/tryton/rpc.py", line 57, in db_exec
result = getattr(connection.common.db, method)(None, None, *args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 271, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
return u.close()
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 134, in close
return json.loads(self.data, object_hook=object_hook)
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 505, in loads
return cls(encoding=encoding, **kw).decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 389, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
JSONDecodeError: Expecting value: line 1 column 2 (char 1)
I've got the prerequisites installed that were listed here and MySQL-python package installed, should there be anything else?
You should create a database on MySQL with it's own tools. Once the database is created you must initialize it using the following command:
trytond -c <config_file> -d <database name> --all
See for complete reference:
http://doc.tryton.org/3.8/trytond/doc/topics/setup_database.html#topics-setup-database.
Once finished, the server will ask for an admin password. Once entered you can conect using the tryton client with the admin user and the entered password.
In order to access tryton from web client you must install and configure the sao web interface, that can be found on:
https://www.npmjs.com/package/tryton-sao
I want Pyramid, Python3, SQLAlchemy and MySQL to play nice on a single machine. This question has been asked before, but it was a long enough time ago that I'm hoping the answer has changed...
Questions:
What driver works for getting a Python 3 Pyramid app to talk nicely to MySQL via SQLAalchemy? Is this even possible?
I've gotten quite far in this project thinking it would be a simple thing to switch out databases, now I'm a bit stuck and downgrading to Python 2.7 is not something I want to have to go through. So my second question is:
If there is no way to talk to MySQL nicely without downgrading, is there a database that Python 3 is ready for (besides SQLite)?
Or lastly, how would I overcome any of the problems mentioned in the 'Stuff I've Tried' section below?
Stuff I've Tried:
PyMySQL
I have PyMySQL installed and I even got it to complain about incorrect passwords and a missing database so it's getting something right. But when I tried to initialize my database (using initialize_foo_db) everything went sour:
2013-02-06 17:18:31,282 INFO [sqlalchemy.engine.base.Engine][MainThread] b'SELECT DATABASE()'
2013-02-06 17:18:31,282 INFO [sqlalchemy.engine.base.Engine][MainThread] ()
Traceback (most recent call last):
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 719, in _do_get
return self._pool.get(wait, self._timeout)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/util/queue.py", line 137, in get
raise Empty
sqlalchemy.util.queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../bin/initialize_mega_db", line 9, in <module>
load_entry_point('mega==0.0', 'console_scripts', 'initialize_mega_db')()
File "/home/sheena/MegaCatalogue/env/mega/mega/scripts/initializedb.py", line 46, in main
Base.metadata.create_all(engine)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/schema.py", line 2567, in create_all
tables=tables)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 2301, in _run_visitor
conn = self.contextual_connect(close_with_result=False)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 2492, in contextual_connect
self.pool.connect(),
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 224, in connect
return _ConnectionFairy(self).checkout()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 387, in __init__
rec = self._connection_record = pool._do_get()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 741, in _do_get
con = self._create_connection()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 188, in _create_connection
return _ConnectionRecord(self)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/pool.py", line 273, in __init__
pool.dispatch.first_connect.exec_once(self.connection, self)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/event.py", line 279, in exec_once
self(*args, **kw)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/event.py", line 288, in __call__
fn(*args, **kw)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/strategies.py", line 168, in first_connect
dialect.initialize(c)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/dialects/mysql/base.py", line 1999, in initialize
default.DefaultDialect.initialize(self, connection)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/default.py", line 177, in initialize
self._get_default_schema_name(connection)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/dialects/mysql/base.py", line 1964, in _get_default_schema_name
return connection.execute('SELECT DATABASE()').scalar()
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1449, in execute
params)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1628, in _execute_text
statement, parameters
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/base.py", line 1691, in _execute_context
context)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/SQLAlchemy-0.7.8-py3.2.egg/sqlalchemy/engine/default.py", line 333, in do_execute
cursor.execute(statement, parameters)
File "/home/sheena/MegaCatalogue/env/local/lib/python3.2/site-packages/PyMySQL3-0.5-py3.2.egg/pymysql/cursors.py", line 108, in execute
query = query % escaped_args
TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
oursql
I tried installing oursql using pip install -r file
where file contains:
#oursql==0.9.3 but need special Python 3 build https://bugs.launchpad.net/oursql/+bug/1051512
https://launchpad.net/oursql/py3k/py3k-0.9.3/+download/oursql-0.9.3.zip
pyramid==1.3.4
And I got:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
myconnpy
This installs without error but I can't seem to find out what I should tell SQLAlchemy to look for. In the appropriate settings.ini file I have tried:
sqlalchemy.url = mysql+myconnpy://...
as well as a bunch of other things. Google is failing me on this one...
UPDATE - a semblance of progress
I've managed to install oursql build dependencies:
sudo aptitude install python-pip libmysqlclient-dev
I then downloaded oursql0.9.3 and ran:
setup.py install
The output was this:
cython not found, using previously-cython'd .c file.
running install
running build
running build_ext
running install_lib
copying build/lib.linux-x86_64-3.2/oursql.cpython-32mu.so -> /home/sheena/MegaCatalogue/env/lib/python3.2/site-packages
running install_egg_info
Writing /path/to/virtualenv/foo/lib/python3.2/site-packages/oursql-0.9.3.egg-info
I opened a shell and apparently the module doesn't exist - it can't be imported anyway. But for some reason it is listed if I say help() then modules