-U username - Connect qilish ya'ni ulash uchun foydalanuvchi nomi.
-w - Hech qachon parol so'rovini bermang.
-W - Ma'lumotlar bazasiga ulanishdan oldin createdb'ni parol so'rashga majburlash.
cmd'ni oching. PostgresSQL o'rnatilgan papkagani o'ching
va undagi Bin papkasiga
kirib, ma'lumotlar bazasini yaratish uchun quyidagi buyurtmani yozing.
createdb -h localhost -p 5432 -U postgres testdb
Yuqoridagini bajarganingizdan so'ng parol so'raydi va o'zingiz uchun istalgan parolni
kiritib ma'lumotlar bazasini yaratishda davom eting. Yaratib bo'lganingizdan
keyin
uni yaratilganligini tekshirish uchun yaratilgan ma'lumotlar bazasining ro'yxatini
ko'rish uchun \l buyrug'rini yozing.
Quyidagiga o'xshash natija kerak
postgres-# \l
________________________________________________________________
List of
databases
Name | Owner | Encoding | Collate | Ctype |
Access privileges
-----------+----------+----------+---------+-------+-----------------------
postgres | postgres | UTF8 | C | C |
template0 | postgres | UTF8 | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgreas | UTF8 | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
testdb | postgres | UTF8 | C | C |
(4 rows)
postgres-#
_______________________________________________________________
Dostları ilə paylaş: