Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install progresql-9.3 properly

Tags:

postgresql

I followed the installation on this document http://www.postgresql.org/download/linux/ubuntu/ and every thing seems to be fine. But when I try to this follow this tutorial: http://www.postgresql.org/docs/9.3/static/tutorial-createdb.html, everything is not fine any more. This is the error I got when I try to create a database table:

$ createdb mydb
WARNING: password file "/home/.../.pgpass" has group or world access; permissions should     be u=rw (0600) or less
WARNING: password file "/home/.../.pgpass" has group or world access; permissions should be u=rw (0600) or less
createdb: could not connect to database template1: FATAL:  role "..." does not exist


$ /usr/local/pgsql/bin/createdb mydb
bash: /usr/local/pgsql/bin/createdb: No such file or directory
like image 775
user228229 Avatar asked Apr 14 '14 05:04

user228229


People also ask

Why is PostgreSQL not installing?

If you encounter an error about being unable to create the postgres service user, turn off any antivirus programs and re-run the installer. >\database directory and manually set the permissions for the \data subdirectory. If the subdirectory \data does not exist, create. Then uninstall PostgreSQL and re-install.


1 Answers

You got one warning and one error.

  • You can handle the warning by this command of line in your terminal:

    $ chmod 600 ~/.pgpass
    
  • When you write "psql" in your terminal, Postgres DBMS try to connect to the one database with your computer name but it can't find it. In other hand Postgrest create a database named "postgres" when it install so try connect to this and create your database. You can connect to "postgres" database easily with this command:

    $ psql postgres 
    
  • If you get the "connections on Unix domain socket "/tmp/.s.PGSQL.5432"?" error start your database with this command:

    $ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
    
  • Check the result with this command:

    $ pg_ctl -D /usr/local/var/postgres status
    
like image 140
Soroush Nejad Avatar answered Sep 21 '22 14:09

Soroush Nejad