sudo apt-get install postgresql
# Install a pgadmin gui
$ sudo apt-get install pgadmin3
# Set a password to "postgres" database
\password postgres
# Create database
$ sudo -u postgres createdb mydb
# Create yourself a superuser database account
$ sudo -u postgres createuser --superuser $USER
$ sudo -u postgres psql
# Next change your password
$ psql
\password $USER
# Create a db with the same name as your login name
createdb $USER
# To create additional databases:
create database somedbname;
# To restart the server
$ sudo /etc/init.d/postgresql restart
# To show created table
\d tablename
# To show all tables
\d
# Quit
\q
# Help
\h AND \?
# Import sql from file
\i filename
# Show query buffer
\p
# Show databases
\l
# Show db permissions
\z
# Install a pgadmin gui
$ sudo apt-get install pgadmin3
# Set a password to "postgres" database
\password postgres
# Create database
$ sudo -u postgres createdb mydb
# Create yourself a superuser database account
$ sudo -u postgres createuser --superuser $USER
$ sudo -u postgres psql
# Next change your password
$ psql
\password $USER
# Create a db with the same name as your login name
createdb $USER
# To create additional databases:
create database somedbname;
# To restart the server
$ sudo /etc/init.d/postgresql restart
# To show created table
\d tablename
# To show all tables
\d
# Quit
\q
# Help
\h AND \?
# Import sql from file
\i filename
# Show query buffer
\p
# Show databases
\l
# Show db permissions
\z
Комментариев нет:
Отправить комментарий