Can't connect to postgresql server installed locally on my machine - postgresql

I have installed the DSP(Dreamfactory Service Platform) locally on my Mac Book Pro using Bitnani.
I have a PostGreSQL server running locally on my Macbook, which I want to connect to using the DSP.
I am successfully able to connect to my PostGreSQL server from other applications, which essentially means that there is no problem with the setup.
However, on trying to connect the same from DSP I get the error:- "Failed to launch service "sql": CDbConnection failed to open the DB connection."
My connection string is :- "pgsql:host=localhost;dbname=Pinu"
Also, the password has been correctly entered.
The port is default as 5432. Whether or not I enter the same in the connection string, the connection always fails.
Even though I am trying to add the service as Remote SQL DB, I know that it's actually on the same local host. Not sure if that is the issue.
I also tried entering - 127.0.0.1 in place of localhost, but still I see the same issue.
Any help in this regard would be highly appreciated!

After talking to you via email, it looks like the root issue here is that you haven't successfully upgraded your DSP to the latest version. We are releasing DreamFactory version 1.8 on Bitnami tomorrow, so you should upgrade to the latest version.
As far as your PostgreSQL issue let's explore some options:
1) Connection strings:
a) pgsql:host=localhost;dbname=Pinu
b)
pgsql:host=localhost:5432;dbname-Pinu
c)
pgsql:host=localhost;port=5432;dbname=Pinu
2) If these don't work, try substituting your localhost with
127.0.0.1 (as you've tried previously, but test this in all scenarios).
3)
pgsql:host=localhost;port=5432;dbname=series1;schema=schema_name_here
Typically, Option A should work without a problem.
Give these a try if you would, and if you need some help upgrading then reach out to me again via email.
--Thanks,
Mark

Related

Strapi instalation has error: connect ECONNREFUSED 127.0.0.1:5432

I just install Strapi but with PostgreQL DB (not using -- quickstart which means SQLite)
1. yarn create strap'-app name-of-my-project,
2. submit all QA=default step-by-step (database=strapi, port=default, login/password nothing fancy, and last without SSL connection)
And the finall result is not so descriptive. Only server error with connecting, which I don't know
Connection test failed: connect ECONNREFUSED 127.0.0.1:5433
Problem solved! (after 2 hours of trying instalation)
The answer is => You have to install PostgreSQL DB too on your computer
Once its done, next, you can run Strapi by yarn develop
So the problem is solved. Other problem in meantime solved
`Server wasn't able to start properly. Error: The server does not support SSL connections. Try to install without SSL connection (last question in Strapi install process)
I know you resolved the issue but just posting this in case anybody needs specific instructions.
I followed this tutorial and it's working for me now.
Sidenote: Once I installed Postgres and ran the command psql postgres it prompted me to enter my password. Despite putting in the correct password it still gave me an error that it is the wrong password, so I ran psql postgres postgres and then entering my password resolved the issue for me.
Instead of downloading postgres you can apply docker and it works the same
Link: https://blog.dehlin.dev/docker-with-strapi-v4
I had the same problem and as Kris says above, you need to install postgresql, pgAdmin and create the database first to then can create your Strapi project linked to you database.
I followed this youtube tutorial (in spanish) to solve it very easy.
Also need to avoid enable SSL for your local project. If you need to change this option in the future you can make it in the strapi config/database.js file.
Good luck!

Mongosqld runs fine, but ODBC fails on test and PowerBI throws error 10060. Connector not working. Windows to two seperate RHEL Servers

The Goal
I need to get data from a MongoDB updated every 15 minutes to use to build into a PowerBI report.
The Gear
I am connected from my windows machine via ssh to an RHEL server (server a). This server is running powerbi connector (SQLD) which is connected to my MongoDB that is running on a different server (server b). I'm also running MySQL on server b. My powerBI connector is installed on server b.
Exactly where I'm at
I am using the steps listed here (and all the associated pages) and have tried everything listed short of writing a config file, as the fact that things are working on mongosqld's end makes me think I don't need it... and if I can't get it working manually, having a config file won't exactly help.
https://docs.mongodb.com/bi-connector/current/connect/powerbi/
Using:
mongosqld --mongo-uri="mongodb://10.xxx.xxx.xx" --auth --mongo-username="ThisGuy" --mongo-password="test"
I successfully map the schema and show an active connection in the command window. I can also access my database from compass using an authorization enabled URL.
When I set up an ODBC connector I use the IP of server a, the user and password from my url, and port 3307. Nothing shows up in the dropdown, when I click 'test' I get the following message:
Connection Failed
[MongoDB][ODBC 1.4(w) Driver]Can't connect to MySQL server4 on '10.xxx.xxx.xxx' (10060)
I have also tried 3306, 27017, and 27015. Just to be safe I also added firewall rules for all traffic on these ports. I've tried this many times, including (just for the hell of it, and I'm kind of new to this stuff) the ip of server b, the ip of my machine, the credentials for MySQL, basically any combination of these things that I can think of.
In powerBI, my odbc driver shows up, and when selected in the dropdown, it asks for a username and password. I have tried both mongo credentials and MySQL. Not sure which I should be using?
regardless, I get the following error inside PowerBI:
Details: "ODBC: ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)
ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)"
Thoughts
I don't control either server, although I have root access, being new to this tech and company I am wary of screwing anything up that a co-worker will have to fix. I read in a different SO thread that maybe I need to downgrade the version of MySQL that is running on the server and that it could fix the problem, but I don't think that it will actually help and am afraid I might screw up something else on the server if I do this:
The C Authentication plugin was developed against MySQL 5.7.18 Community Edition (64-bit), and tested with MySQL 5.7.18 Community Edition and the latest version of MongoDB Connector for BI. The plugin is not compatible with MySQL Server or Connector/ODBC driver version 8 and later.
https://dba.stackexchange.com/questions/219550/access-denied-when-connecting-to-mongosqld-with-mysql
Maybe the problem is that server B is listening to server a on port 3307, and that there is another unknown port (not mentioned above) that my ODBC driver must be listening to? I'm not sure how to test for this when you get a step away like this.
So that's it. I'm really stuck and would love some help, I am going to try the downgrade tomorrow if nothing else shakes loose and will keep this thread updated.
Thank you for reading

Connect Postman to Postgres

There is a problem.
I need to access Postgres Database from Postman. Database isn't local, it is on a server, but I have full connection string (host, db_name, user_name/password, scheme).
Any chances to do it?
I tried PostgREST, but I can't install it. I have LIBPQ.dll is not found error. I installed it but it was no help, I still have 0xc00007b error.
So that I can't install PostgREST.
Should I install it on the server where DB is located?
And is there any other way?
update: I managed to overcome all the errors (here is the note how to overcome 0xc00007b error: https://postgrest.org/en/stable/install.html).
Now I can call postgrest from cmd with the flag --help, but it's still not connected to the database.
update2: I managed the connection by putting postgrest.conf filled file in the same directory as postgrest.exe file and running in from cmd.
search for app and browser control in start menu, then select exploitation control :
set randomize image ASLR to off

Google Cloud SQL: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 0

I'm desperate since my Google Cloud SQL instance went down. I could connect to it yesterday without problem but since this morning i'm unable to connect to it in any way, it produces the following error: The database server returned this error: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 0
This is what I did to try to fix this:
restart instance
added authorized ip-addresses in CIDR notation
reset root password
restored backup
pinged the ip-address and I get response
All these actions completed but i'm still unable to connect through:
PHP
MySQL workbench
Ubuntu MySQL command line
All without luck. What could I do to repair my Cloud SQL instance. Is anyone else having this problem?
I'm from the Cloud SQL team. We are looking into this issue, it should be resolved soon. See https://groups.google.com/forum/#!topic/google-cloud-sql-announce/SwomB2zuRDo. Updates will be posted on that thread (and if there's anything particularly important I'll edit this post).
The problem seems to only affect connections from outside Google Cloud. Clients connecting from App Engine and Compute Engine should work fine.
Our company has same problem.
We are unable to connect through both MySQL workbench and MySQL command line.
Our Google Appengine application has no problems to connect since its not using external IP.
there.I encountered the same problem.You need to find out your public ip address,for that type "my public ip" in Google.Now click on your Cloud SQL instance that you created,under that click on ACCESS CONTROL tab and then click on Authorization tab under that.Under Authorized network,give any name you want to the network and copy your public ip address in the network.Now save changes and try to run the command from console.It should work fine.

Remote Database Connection Setup in Netbeans

I'm totally junior in this area :)
I have JAVA version 7 on my PC.
I want to connect my PostgreSQL database to NetBeans.
Based on my search I found that I should get JDBC driver. so I downloaded JDBC41 Postgresql Driver, Version 9.3-1100 jar files from here.
then based on what I found for connection remote Mysql, did similar changes to connect to my PostgreSQL database.
As you can see in the image, connection couldn't established.
Based on what my host says, I added my IP address to "Remote PostgreSQL Database Access" page of my host.
I'm not sure my host name is correct. I used Dedicated IP Address of my site.
Any suggestion would be appreciated. Thanks
My fault was entering wrong user name and pass instead of using user name and password of database :(