Tell me more ×
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

2 Answers

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

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

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.