Sunday, December 09, 2007

postgresql adventure: part 1, usage and installation on gutsy

I'm actually, start from using mysql, and actually, learn mysql in class. Since i'm on my vacation, so i decide to try out postgresql. Which I qoute from their website, "the world most advance open source database".

So install I did. Like many open source software, it is available on ubuntu repository, can be found using synaptic.

unlike mysql, which only have one program, mysql, to run everything, postgress sql have a few. And actually need a few steps before you can actually start using the database.

1) Basically, first give password to postgres account, this is equivalent to root, on mysql. Also so that you can use it later for pgadmin, a graphical frontend for postgreSQL. Because you will need a password, to login, even you set no password as your password. psql, is equivalent to mysql, the shell to access the database.
sudo -u postgres psql
then type
alter user postgres with password 'your password';
type \q, to quit.

2) Sometime i am lazy, to type long, so i grant access to my own account, since this is a development machine, so I create a user account, as root, for the postgresql server.

So I type:
sudo -u postgres createuser yourname
then it will prompt a few things, just say yet.

Then it done

No comments:

Post a Comment