1.3. Creating a Database
The first test to see whether you can access the database server is to try to create a database. A running
PostgreSQL server can manage many databases. Typically, a separate database is used for each project or
for each user.
Possibly, your site administrator has already created a database for your use. He should have told you
what the name of your database is. In this case you can omit this step and skip ahead to the next section.
To create a new database, in this example named
mydb
, you use the following command:
$
createdb mydb
This should produce as response:
CREATE DATABASE
If so, this step was successful and you can skip over the remainder of this section.
If you see a message similar to
createdb: command not found
then PostgreSQL was not installed properly. Either it was not installed at all or the search path was not set
correctly. Try calling the command with an absolute path instead:
$
Do'stlaringiz bilan baham: |