Advertisement
Guest User

Untitled

a guest
Nov 25th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
  2. pg_ctl: another server might be running; trying to start server anyway
  3. server starting
  4.  
  5. rake db:create all
  6. could not connect to server: No such file or directory
  7. Is the server running locally and accepting
  8.  
  9. rake aborted!
  10. Don't know how to build task 'all'
  11.  
  12. me$ psql --version
  13. psql (PostgreSQL) 9.2.3
  14. me$ which psql
  15. /usr/local/bin/psql
  16.  
  17. ps aux | grep postgres
  18.  
  19. 562 0.6 0.0 2432768 588 s000 S+ 12:45pm 0:00.01 grep postgres
  20.  
  21. could not connect to server: No such file or directory
  22. Is the server running locally and accepting
  23. connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
  24.  
  25. ls -l /tmp/.s.PGSQL.5432
  26. srwxrwxrwx 1 you wheel 0 Nov 16 09:22 /tmp/.s.PGSQL.5432
  27.  
  28. ls: /tmp/.s.PGSQL.5432: No such file or directory
  29.  
  30. $ grep unix_socket /usr/local/var/postgres/postgresql.conf
  31. #unix_socket_directory = '' # (change requires restart)
  32. #unix_socket_group = '' # (change requires restart)
  33. #unix_socket_permissions = 0777 # begin with 0 to use octal notation
  34.  
  35. $ mkdir /var/pgsql_socket/
  36. $ sudo mkdir /var/pgsql_socket/
  37. $ ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
  38.  
  39. usr/local/var/postgres/server.log
  40.  
  41. DETAIL: The data directory was initialized by PostgreSQL version 9.1, which is not compatible with this version 9.2.3.
  42.  
  43. LOG: database system was shut down at 2012-02-27 19:18:09 PST
  44. LOG: autovacuum launcher started
  45. LOG: database system is ready to accept connections
  46. LOG: received fast shutdown request
  47. LOG: aborting any active transactions
  48. LOG: autovacuum launcher shutting down
  49. LOG: shutting down
  50. LOG: database system is shut down
  51. LOG: database system was shut down at 2012-02-27 21:30:56 PST
  52. LOG: autovacuum launcher started
  53. LOG: database system is ready to accept connections
  54. FATAL: role "shawsome" does not exist
  55. FATAL: role "shawsome" does not exist
  56. FATAL: role "shawsome" does not exist
  57. ERROR: role "myname" already exists
  58. STATEMENT: CREATE ROLE MYNAME PASSWORD 'md5b42169a737cea337fe663aa9fbb1df19' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
  59.  
  60. WARNING: pgstat wait timeout
  61. WARNING: pgstat wait timeout
  62. WARNING: pgstat wait timeout
  63. LOG: database system was interrupted; last known up at 2012-02-28 21:32:13 PST
  64. LOG: database system was not properly shut down; automatic recovery in progress
  65. LOG: record with zero length at 0/1714388
  66. LOG: redo is not required
  67. LOG: autovacuum launcher started
  68. LOG: database system is ready to accept connections
  69. WARNING: pgstat wait timeout
  70. WARNING: pgstat wait timeout
  71. FATAL: database files are incompatible with server
  72. DETAIL: The data directory was initialized by PostgreSQL version 9.1, which is not compatible with this version 9.2.3.
  73.  
  74. $ cd /usr/local/bin
  75. $ rm postgres
  76. $ ln -s /Library/PostgreSQL/9.2/bin/postgres postgres
  77. $ rm psql
  78. $ ln -s /Library/PostgreSQL/9.2/bin/psql psql
  79. $ rm pg_ctl
  80. $ ln -s /Library/PostgreSQL/9.2/bin/pg_ctl pg_ctl
  81.  
  82. $ sudo -u postgres createuser --superuser $USER
  83. $ sudo -u postgres createuser --superuser user_name
  84. $ sudo -u postgres psql postgres
  85.  
  86. postgres=# password user_name
  87.  
  88. postgres=# password <username>
  89.  
  90. $ createdb my_database
  91.  
  92. /Library/PostgreSQL/9.2/datapostgresql.conf:
  93. listen_addresses = 'localhost'
  94.  
  95. /Library/PostgreSQL/9.2/datapg_hba.conf:
  96. # "local" is for Unix domain socket connections only
  97. local all all md5
  98.  
  99. $ sudo -u postgres pg_ctl -D /Library/PostgreSQL/9.2/data -l /Library/PostgreSQL/9.2/data/server.log start
  100.  
  101. sudo -u postgres pg_ctl -D /Library/PostgreSQL/9.2/data/ stop -s -m fast
  102.  
  103. gem 'pg'
  104.  
  105. $ bundle install
  106.  
  107. development:
  108. adapter: postgresql
  109. encoding: unicode
  110. host: localhost
  111. database: my_database
  112. pool: 5
  113. username: user_name
  114. password: password
  115.  
  116. $ createdb my_database_dev
  117.  
  118. export PATH=/Applications/Postgres93.app/Contents/MacOS/bin/:$PATH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement