Database Creation
From Antiflux Wiki
(Difference between revisions)
Revision as of 17:47, 15 March 2005
MySQL
To create a database called "foo" for the user "bar":
mysqladmin create foo
- 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.