i had problem to creating super user with this command
sudo -u postgres createuser --superuser wahyu(wahyu is my user name) i've already using root access to do that but i found this
[root@dhcppc41 user]# sudo -u postgres createuser --superuser wahyu
could not change directory to "/home/user"what should i do?
also, i had problem when trying importing sql or something.. because i dont know, i'm new.
following tutorial here, actually i'm stuck at step 19 and 21, and i need advice. i already ask there, but they won't help.
back to quesion, i dont understand, what should i input in this command.
\i '<path to file>'; but found error
no such file or directoryi know this is because i don't know where to input there. i need advice to creating superuser then the location of the sql that have to import. thank you :)
sorry if this question not related with the forum :)
2 Answers
ok this isnt really the forum for this but I will try to answer quickly the first problem is you are in root.
Use your user account .. open a new terminal so you aren't using root then the first command should work.
The other question is not easily answered because I really don't know what this tutorial is showing but its saying to make a database or maybe import one
\c <database> is the database name
\i '<path to file>'; is where the path to file where the database file will be stored...
so if you had the database name called DB and you want it stored at /home/yourusername/databases the lines would be
\c DB
\i /home/yourusername/databasesI have no way of telling you what you actually need in those lines themselves .. if it is a database that you are supposed to be importing then they should have given that or maybe do give that but ... I didn't go through the whole post.
0This is how I set up postgresql DB and import database on fresh PC maybe it will help:
- Install packages postgresql (server) and pgadmin3 (gui client)
- You can't login afterwards through pgadmin anyhow. That's because connect requires password to be filled, and postgres does not have any password filled in. Do this:
- sudo -u postgres psql
- alter user postgres PASSWORD 'YourPassword';
- ctrl + d
- now you can run pgadmin, connect to the localhost server with login 'postgres' and new password. Create connection to 'localhost', database postgres, user postgres.
- In pgadmin you can create users, import sql database dumps, etc.