converted to use mysql instead of sqlite3