Database Creation

From Antiflux Wiki

(Difference between revisions)
Jump to: navigation, search
Current revision (19:04, 29 September 2007) (edit) (undo)
 
Line 13: Line 13:
Like MySQL, PostgreSQL has its own user database, but passwords are not necessary for its ident authentication. <code>/usr/local/sbin/adduser.local</code> creates a new Postgres user for each new system user.
Like MySQL, PostgreSQL has its own user database, but passwords are not necessary for its ident authentication. <code>/usr/local/sbin/adduser.local</code> creates a new Postgres user for each new system user.
 +
 +
[[Category:Admin]]

Current revision

MySQL

To create a database called "foo" for the user "bar":

  1. mysqladmin create foo
  2. in mysql(1): grant all on foo.* to bar@localhost identified by 'password'

You can get a password from pwgen(1). If the user already exists in the MySQL user database, you can omit the 'identified by' bit.

PostgreSQL

The user can run createdb foo themselves. To create the database for them, use sudo -u bar createdb foo.

Like MySQL, PostgreSQL has its own user database, but passwords are not necessary for its ident authentication. /usr/local/sbin/adduser.local creates a new Postgres user for each new system user.

Personal tools