Re: How to create a new user with password in commandline with no prompt for password

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vishal

Now I m able to create new user using command line
I ve created a database named 'postgres' for postgres user and I ve created the new user  in  comand line

The steps I ve used


[root@g151 ~]# su postgres -c "createdb postgres"
could not change directory to "/root"
CREATE DATABASE
[root@g151 ~]# echo "CREATE USER globus WITH PASSWORD 'globus' CREATEDB;" | psql -U postgres -d postgres
psql: FATAL:  Ident authentication failed for user "postgres"
[root@g151 ~]# su postgres -c "echo \"CREATE USER globus WITH PASSWORD 'globus' CREATEDB;\" | psql -U postgres -d postgres"
could not change directory to "/root"
CREATE USER
[root@g151 ~]# su globus -c "createdb rftDatabase"
could not change directory to "/root"
CREATE DATABASE



Thanks to Vishal, Shane and pgsql-admin list

Thanks/Regards
Rajiv
Project Associate,
CARE,MIT,
Anna University

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux