Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

3 Answers 3

up vote 0 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
add comment

@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
add comment

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
add comment

Your Answer

 
discard

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.