fpdb on Ubuntu Ibex

Version 3, last updated by mct at over 16 years

Downloading fpdb

From git sources

This will grab a bleeding edge copy from Steffan's repository. There is no compilation involved.

$ sudo apt-get install git-core
$ git clone git://git.assembla.com/fpdb.git fpdb

will plonk it in a subdirectory of your current directory.

Installing and configuring a database

You will also need to have a database running -- you can choose mysql or postgresql. In each case you must create a database and user for fpdb to use.

(A) mysql

If you don't yet have mysql installed, install it with

$ sudo apt-get install mysql

Then use the mysql shell to create a database called fpdb and grant all privileges to a user called 'fpdbuser':

$ mysql --user=root --password=YourMysqlRootPassword
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.60-log Ubuntu Linux mysql-5.0.60-r1

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE fpdb;
mysql> GRANT ALL PRIVILEGES ON fpdb.* TO 'fpdbuser'@'localhost' IDENTIFIED BY 'newFpdbPassword' WITH GRANT OPTION;

 

(B) postgresql

If you want to use postgresql, make sure the dependencies are installed and your postgres root user has a password as follows:

$ sudo apt-get install postgresql, python-psycopg2, pgadmin3
$ sudo -u postgres psql postgres
Welcome to psql 8.3.5, the PostgreSQL interactive terminal.          

Type:  \copyright for distribution terms
       \h for help with SQL commands   
       \? for help with psql commands  
       \g or terminate with semicolon to execute query
       \q to quit                                    

postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD 'newPostgresRootPassword';
ALTER ROLE                                                           
postgres=# \q                                           

You can use a graphical tool to create the fpdb database and user:

$ pgadmin3

Click connect (top left; a plug) and fill in:

  • name: a name you give to this connection
  • host: localhost
  • password: newPostgresRootPassword

You may choose to store the password, if you do you will be warned that it will be stored in plaintext in ~/.pgpass

You should now be connected to postgres on localhost. Expand the + next to it. Add a user called fpdbuser by right clicking on Login Roles->New Login Role. Just enter the name 'fpdbuser' and a password.

Now create the fpdb database by right clicking 'Databases->New Database'. Call it fpdb and set the owner to fpdbuser.

Configuring fpdb

Now you need to tell fpdb about the database. Copy 'HUD_config.xml.example' from the pyfpdb directory to '/home/yourname/.fpdb/HUD_config.xml' -- fpdb will read this in preference to the example config. Open it in a text editor and find the section

    <supported_databases>
        <database db_name="fpdb"         db_server="mysql"      db_ip="localhost" db_user="fpdb"   db_pass="YOUR MYSQL PASSWORD" db_type="fpdb">    </database>
    </supported_databases>

and alter it as appropriate with your password, 'fpdbuser' for the db_user, and 'mysql' or 'postgresql' as chosen, e.g.

    <supported_databases>
<database db_ip="localhost" db_name="fpdb" db_pass="your_fpdbuser_pass" db_server="postgresql" db_type="fpdb" db_user="fpdbuser"> </database>
</supported_databases>

OK, change directory to fpdb/pyfpdb and run fpdb.py (you may need to add execute permission with chmod u+x fpdb.py). If it works and connects to the fpdb database you created, you'll be told you need to create the tables.. follow the instructions!

 

Recent Versions

Choose two versions to compare, or click the link to view it.

History Key

  • New Content
  • Removed content