10/11/2023 0 Comments Brew install postgresql 9.3![]() ![]() This formula is keg-only: so it was not symlinked into /usr/local. Add /usr/local/opt/postgresql-9.3/bin to your PATH Call all programs explicitly with /usr/local/opt/postgresql-9.3/bin/. To use this PostgreSQL installation, do one or more of the following: If the server is having problem stoping, try: 'pg_ctl -D /usr/local/var/postgres stop -m fast'įind more by running 'brew info postgresql'. To stop the server: 'pg_ctl -D /usr/local/var/postgres stop' Or start with postgres utility pg_ctl: pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log startĬreate your users and db by using, createdb and createuser. Start the postgres server: postgres -D /usr/local/var/postgres Initialize the postgresql data storage area (directory). Inclue something along these lines: LoadModule php5_module /usr/local/opt/php54/libexec/apache2/libphp5.so Uncomment line: 'LoadModule php5_module libexec/apache2/libphp5.so' OS X stock Apache config file is found at '/private/etc/apache2/nf' and you need to tell apache to use the new homebrew PHP module instead to the system default one. export PATH="$(brew -prefix homebrew/php/php55)/bin:$PATH" Make sure that your shell is using PHP provided by homebrew. Make sure your timezone is set up correct. You will find them in '/usr/local/etc/php/ PHP from homebrew also introduce seperate php.ini file. # Install PHP 5.4 with PostgreSQL and Mariadb supportĪny problems try installing upload progress with:īrew install -with-homebrew-php php54-uploadprogress). PHP 5.5/5.3 is installed the same way as PHP 5.4 by simply replacing php54 with php55/php53. Nothing is stopping you from having different PHP installations at the same time. * Install howebrew ( ) by following the documentation found on the page. * Install XCode from Apple App store and xcode command line tools from. Does not provide any background information outside the needed steps getting PHP, Apache and the database server running. Hope this helps methodically troubleshoot this issue.Note:An quick, stort and easy starting point. If the postgres server is not started, please try restarting the postgres instance with the command as appropriate to the operating system you are using.įor Mac OS the command to restart was brew services restart postgresql The process is not running at all or there is some other issue, which can again be seen in the log (which can be found with the steps above). Once you get the port, which was 5488 in my case, connect to postgres server with an option "-p" to connect (replace with the port found from the log): psql -p 5488 #add host and other options as neededī. So, you can grep that as well like: egrep "*listening*" /usr/local/var/log/postgres.log Open the log file and confirm the port number from the log line like below: There are other articles on how to check the statusįind the log location with the pid (5833 is the pid of postgres from the above command, replace the pid with your pid from the command output you get): $ lsof -p 5833 | grep log You can confirm postgres server status with pg_ctl or other commands to confirm. If you DO NOT get the output like above, most likely the postgres server is not running. Got the pid of 5833 from the output below: UID PID PPID C STIME TTY TIME CMDĥ01 5833 1 0 12:07PM ? 0:00.13 /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres WARNING: the process below will destroy any existing postgres databases you may have run install brew install postgresql -force stop the running postgres server (if any) pgctl -D /usr/local/var/postgres stop destroy your postgres data directory (you will have to supply root password to do this) sudo rm -rf /usr/local/var/postgres recreate a postgres data dir initdb /usr/local/var. Maybe the port is not the default port used (which is 5432)- How to confirm this? ps -ef | grep UID & ps -ef | grep postgres This issue might occur for one of the reasons below:Ī. The solution is as simple as reinstalling the gem. When you install the ‘pg’ gem, it detects which version of Postgres is installed and sets the domain socket path appropriately. The fix is simple, if a little suprising. At no point had I told Rails to connect to postgres on that path, Rails had assumed it, and now its assumptions were wrong. I could’ve messed around with the config and made Postgres use the domain socket it was previously, or told Rails explictly how to connect, but both of those approaches seemed like work I shouldn’t have to do. The problem was that the new version of Postgres listens on /tmp/.s.PGSQL.5432 instead. ![]() Is the server running locally and acceptingĬonnections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? Even though Postgres was definitely running, suddenly I was getting:Ĭould not connect to server: No such file or directory (PG::ConnectionBad) However, trouble struck once I tried to run any specs that needed to connect to Postgres. The process was smooth and pg_upgrade is a very handy tool. I recently upgraded Postgres from 9.2 to 9.3 using brew upgrade postgres. I was looking for a long time, and this was the most clean and neat solution:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |