I was trying to run heroku local or heroku local web and everything was working fine. After importing the data from my heroku remote to my local environment, it started to throw me the following error:
After searching for the solution in some places, I tried restarting the postgresql service with brew services restart postgresql and it started normally but I kept receiving the error. I also tried to delete the postmaster.pid as suggested on this SO post PG::ConnectionBad - could not connect to server: Connection refused but didn't find the file.
Well, finding the solution was easier than I thought.
On this same post (PG::ConnectionBad - could not connect to server: Connection refused) it suggested to check the logs before deleting the file and I did even that I haven't finding the file to be deleted.
When I checked the logs, I came across the following:
So, I checked the heroku's Postgres version and it uses the 12 as default but brew uses the latest, which is the 13th.
To sum up, I did a dump from a Postgre v12 to Postgre v13 and this is incompatible, so I'm going to downgrade my local Postgres to work with my data as expected.
To do that, I did the following:
brew uninstall postgres - to remove v13
brew install postgresql#12 - to install a specific version
brew services start postgresql#12 - to start the new version
Cool fact, I didn't need to restore or modify the data because it wasn't deleted even uninstalling the Postgresql.
Related
I have been trying to install Craft CMS (free version), but failed each time. At first I attempted to install it on a remote VPS with Ubuntu 20.04 server and MySQL database:
Installation via Composer failed:
In CreateProjectCommand.php line 438:
Could not find package public_html/craft with stability stable.
Then I attempted to install Craft CMS on VPS manually. I got as far as running the installer and entering my username, email and password, but that resulted in "Install failed. Please, check your logs for more info" message. Checked the logs and the problem was as follows:
2022-04-06 22:33:39 [-][-][-][error][craft\base\ApplicationTrait::getIsInstalled] There was a problem fetching the info row: SQLSTATE[42S02>
The SQL being executed was: SELECT *
FROM `info`
WHERE `id`=1
LIMIT 1
2022-04-06 22:33:39 [-][-][-][error][yii\db\Exception] PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'craftdb.inf>
Then on my local machine with Ubuntu 18.04 using Composer got the same error as under VPS. When attempting the manual install I did not get past the error
HTTP 503 – Service Unavailable – craft\web\ServiceUnavailableHttpException
Perhaps it is the free version problem. Or any other ideas?
I am running Rails 4.2.2 and my postgres gem is 0.17.1 and everything was running fine yesterday but today when I opened the console and tried connecting to the database I saw this error:
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
...then when I tried connecting to the database through running psql, I see the following:
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
Referenced from: /usr/local/bin/psql
Reason: image not found
Abort trap: 6
As far I know I havent changed anythingsince yesterday so I'm not sure why this is happenning. I tried adding host: localhost to my database.yml with no luck. It may be worth noting when I try to connect to the DB using a program like PSequel, I see the following:
could not connect to server: Connection refused
is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
Has anyone seen this?
Neara's response to this post provided an answer for me: PostgreSQL server won't stop.
Basically had to run:
$ brew services list
$ brew services restart postgresql
They posted a workaround in case services cannot be found.
I cloned a repository in a RoR app using postgres but I'm unable to work locally. When I run the server I get this error:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I've tried many things: the password reset doesn't work because it's not recognizing as a user...I've tried adding the underscore before postgres user...sudo su doesn't work...help!
Ok, so after shuffling through the google return links for the original error message, I came across this: http://www.brentmc79.com/posts/psql-could-not-connect-oh-fuck-you
Very straightforward list of commands that shut down the database, force a reset, and then a manual restart...it will also return prompts that you'll get. Very helpful. I'm getting a CSS error now, but it looks like the database setup is ok. Thanks!
I just updated my gems. And now I have problems connecting to my postgresql database. I get the error:
PGError
could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
I tried uninstalling the gem and reinstalling, I also tried to change the paths file and put '/usr/local/bin/' on top. I tried some of the things from post:
Repairing Postgresql after upgrading to OSX 10.7 Lion
This app worked fine before updating my gems, other apps still connect just fine, to the same server. I have the same settings in my database.yml file.. what could be wrong?
The error comes from the PostgreSQL server and I have seen it many times. It tells you that you are trying to connect via Unix domain socket (and not via TCP/IP!) to a server that is running locally and listening at port 5432. But no server can be found that would accept connections like that.
You did not mention where the PostgreSQL server resides - I assume you actually mean to connect to a database server on your local machine.
Check your setup, especially your pg_hba.conf file. You need a line like:
local mydb myuser md5
or
local all all peer
or some other connection method that includes your user and database.
These would not help in your case:
host ...
or
hostssl ...
They concern TCP/IP connections, not local connections via UNIX domain socket. When you connect to localhost you actually use TCP/IP via local loop and these settings apply.
Remember to reload after you edit pg_hba.conf. I quote the manual at the linked site:
If you edit the file on an active system, you will need to signal the
postmaster (using pg_ctl reload or kill -HUP) to make it re-read the
file.
I've installed the MySQL workbench version 5.2.34 and having problems creating a local connection. I'm getting an error saying "Can't Connect to MySQL Server on 127.0.0.1'(10061)" when i try connecting to Localhost on Port 3306. I tried restarting the service but i don't have the option to stop/start/pause or resume using Windows 7. The status is just set to "starting". I also tried "net stop mysql" from the command line in DOS but get the following error: "The service is starting or stopping. Please try again later"
Does anyone know if this is another bug in the Workbench or is there a quick solution to get around this?
You can restart mysql from services. Also, check error log (by default, on Windows 7 machine it's under ...ProgramData\MySQL\MySQL Server [version]\data
Sounds like a problem with MySQL itself starting up. You may have to kill the mysqld process if nothing else gets it into a started or stopped state, and then investigate the .err logs in your data directory.
This solution uses the window's mysql installer which you have used to install your MySQL.
Even though this post is very old, I have wasted around 2 hours and hence want to post this so that it can save someone else's time.
I have tried every other way of restartring the service, but mysql service just wont start.
Start your windows mysql installer. For me it was "mysql-installer-community-8.0.20.0"
Then remove/uninstall the SQL Server and remove all configurations
Manually delete the SQL Server folder from "C:\Program Files\MySQL\MySQL Server 8.0."
Start your mysql installer again and install the SQL Server again
You can check now that the MySqL Server has started.