Search code examples
pythonmysqlmyisamweb.py

Using web.py's web.database with MyISAM


I have a web.py app that's using web.database for its DB work. It's running on a low-powered VPS, so I turned off InnoDB to save resources. However, when I try to access the database, I get this error:

    <class '_mysql_exceptions.NotSupportedError'> at redacted
(1286, "Unknown storage engine 'InnoDB'")

Python  /usr/lib/python2.7/dist-packages/MySQLdb/connections.py in defaulterrorhandler, line 35
Web GET redacted

This message is fairly self explanitory, telling me that I don't have InnoDB enabled. But how do I tell my app to use MyISAM instead?


Solution

  • This is not related to web.py app, you have to create tables with MyISAM storage engine.

    To specify explicitly that you want a MyISAM table, indicate that with an ENGINE table option: CREATE TABLE t (i INT) ENGINE = MYISAM;