Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing application using quickly Pygtk and glade.

this application should have database connection (such as MySQL) for reading and writing data from the local or outsourcing machine \ server.

However, in my machine there is MySQL installed, but when releasing the app it sould be installed on another ubuntu machine, which may not have mysql and moreover not the same database with the required database name and structure....

So my questions are:

  1. Is it a good choice using mysql as database

    1.2 If not what is?

  2. Is it posible to embeding mysql or other database program during the installation from ubuntu software center?

    2.2 If it's posible: hwo(any tutorial?)

  3. Where to store secure data outside the mysql (or whatever) for conecting the database every time a user launch the application

share|improve this question
up vote -1 down vote accepted

Consider using an outside MySQL, like xeround

Consider using XML, it can be a poor mans dB.

If you REALLY need mysql. Then you can make mysql-server a dependency for your app. But that's not a good idea... It will require you setting up mysql on install of your app. That can get tricky.

A trick for setting up the database once you install mysql, is to go to phpmyadmin, and "export" your db. Choose sql export. Then open the file it downloads. It will be a massive sql command. Copy-paste than into your program, and once you get the needed info from the user (mysql username/password), you can execute that export, and then their database will look identical to the one you created on your local machine.

Though again, I typically recommend against using mysql-server on local machines unless its REALLY needed.

share|improve this answer

You should consider using SQLite as database engine. It is very easy to use because it stores everything on disk in a single file, and Python comes with a SQLite module by default.

You can also use an ORM, such as SQLObject or SQLAlchemy so you write your code once, and can deploy on all kind of database engines. It makes things more fun too, because of the Pythonic approach.

share|improve this answer

@triunenature suggested using an external (hosted) database like Xeround. I should note that this would introduce very high latency, but it could be acceptable if the application does not query the database intensively, or if perhaps you can do things in an asynchronous manner with some sort of local cache to hold the data until needed by the application. Certainly it would get around the pain of embedding the database with the application. Just in case this is a relevant scenario, I wanted to mention that Xeround has shut down, but there are several alternatives, both for MySQL (ClearDB) and other popular databases - since you are considering other options - such as Postgres (Heroku Postgres), Redis (Redis Cloud), and MongoDB (Mongolab).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.