Connection to Postgresql database failing - database

I'm trying to connect to my localhost Postgresql database and I'm getting an error:
Connection to database... failed
No other message provided.
I'm using using pgAdmin3 connecting to Postgresql 10.1
I've been connecting to this database using the same user (and password) and another user via my app successfully all the while but it just failed to connect to the database now. No users seems to be able to connect to the database
Edit: after further checks I noticed Postgresql is not listening on the port 5432.
I've checked the postgresql.conf file and it looks fine
listen_addresses = '*', port = 5432
I'm kind of new to Postgresql. Sorry if it's something obvious I'm missing out. Still looking for how to start postgresql or make it listen on the port.

Related

Connecting to SQL from Bamboo still throws error Login failed for user

I am attempting to connect my Bamboo instance to SQL Server, but I am unable to do so because of the error Login failed for user 'Bamboo'. Investigation into the log files shown in the location
C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG
throws an error that I should not be getting at this stage of my attempted login. Server is configured for Windows authentication only. Currently able to login using same SQL Server credentials to access the database, just not via Bamboo.
The reason why this should not happen is because my server is already set up to do so, and I will list all of the steps that I have taken to prevent this error. In my localhost SQLEXPRESS server I have checked SQL Server and Windows Authentication mode. Once I restarted SQL Server, this worked as I was able to log in with the credentials that I added to a user called Bamboo.
The user I added is mapped to the database called BambooDatabase as a db_owner. The number of concurrent users is unlimited and I have tried disconnecting from SQL Server just to check if that was a problem, but still no difference. I added 2 more users with connect access and mapped to BambooDatabase.
I have went to the SQL Sever Configuration Manager and enabled TCP/IP and made sure that the IP addresses was pointing to 1433. And then configured my firewall to all access to 1433 as well. The fact that my error logs for SQL Server are appearing makes this seem that everything should be fine here. So with tested 3 users on SQL credentials everyone logged in successfully and all have the relevant permissions needed. All three gave the same error when trying to connect from Bamboo.
I am trying to connect to Bamboo like this:
Direct JDBC connection.
Driver class name: net.source.jtds.jdbc.Driver
Database URL: jdbc:jtds:sqlserver://localhost:1433;DatabaseName=BambooDatabase
User name: Bamboo
Password: SQL Server password
Checked overwrite existing data
Then once I click continue the log in error throws. Have I missed something here, I cannot see what I could do differently, I have tried to connect to SQL Server from Bamboo several different ways but have had no success. I am using SQL Server Express and the Bamboo version 5.11.3, I am testing upgrading from 5.11.3 to 5.15 with larges amounts of data which is why I am using that version.
Error from Bamboo is:
Error accessing database: java.sql.SQLException: Login failed for user 'Bamboo'.
Error from SQL logs is:
Login failed for user 'Bamboo' Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only. [CLIENT: 127.0.0.1]
Are you running Bamboo en SQLExpress on the same machine? If not, you should look into the remote access configuration.
In the SQL Sever Configuration Manager, make sure that you entered 1433 for the IPAll entry as well. And start the SQL Browser service for good measure, this is especially important when using a names instance, but going after the errorlog folder you copy/pasted, that's not the case.
For testing purposes, you might want to disable the firewall all together and reactivate is after you get the connection up.
Another thing to try if you're connecting on the same machine, is use the loopback address 127.0.0.1 instead of the localhost alias.

Accessing an external remote postgres database using pgadmin4 from a local machine produce password authentication fail

I am trying to connecting to a remote database with pgadmin4 using putty to portforward so I can connect to a local database on a remote server. This works normally like a charme.
I switched computer and set up the database setting and putty the same. (db: pgpass.conf on old maching with copy&paste to new db connection setting in pgadmin4 and a configuration file export/import for putty - that is 1:1 transfair).
When trying to connect to the remote local database, on the old computer it still works and on the new one i get this error message:
FATAL: password authentication failed for user "postgres" FATAL:
password authentication failed for user "postgres"
On Windows 10 I don't find the password file? Is there any? What is wrong with the setting in pgadmin4?
Found the solution, I don't have SSL so I have to disable it, and the connection is established.
Go to the servers properties, select the tab Connection go to SSL mode and choose Disable - finally Save it

Connection refused to PostgreSQL server

I am currently setting up a postreSQL server on my Windows computer.
I want to create my first database, but couldn't create the createdb function due to a password authetification failed. Thus I found the following question on this website:
How to configure postgresql for the first time?
However, I think I forgot the ; at the end of :
ALTER USER postgres with encrypted password 'xxxxxxx';
And now, when I try to launch psql, I have the following errors:
Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Active code page: 1252
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Press any key to continue . . .
Any idea of what I could do to solve the problem?
Do you think it is really the missing semi column that caused the problem?
Do you have any tutorial on how to setup a postgreSQL database on Windows? All the one I found until now were for Linux only.
The error you're getting appears to be from Postgres not currently running, rather than an authentication error as you're presumed. The PSQL client or whatever PG client you're using is attempting to establish a connection on the default port but nothing is there.
If Postgres isn't currently running, try finding it (Via CTRL-Alt-Delete). If it's running, try terminating it and starting it up again. Hopefully that fixes the problem... Otherwise your port 5432 might be blocked for some reason.
If all fails, I am still skeptical the parentheses could cause this error because it's not an authentication error. Try to reinstall Postgres with a clean install.

MySQL Unable to connect to remote host

I am just wasting too much time with this issue. My final goal is to change the collation of the Amazon RDS DB from latin to utf8. To accomplish that, there is a lot of information out there, and yet, non of that has worked for me.
First of all I tried to prompt mysql:
mysql -h ###.###.us-west-1.rds.amazonaws.com -p --port=3306
but it raise an ERROR 2003 (HY000): Can't connect to MySQL server on '###.###.us-west-1.rds.amazonaws.com' (60)
If I try using telnet:
telnet ###.###.us-west-1.rds.amazonaws.com 3306
Trying 54.###.##.##...
telnet: connect to address 54.###.##.##: Operation timed out
telnet: Unable to connect to remote host
Looking at the aws.docs says that I have to authorize access to my cache cluster. But I could't get that far. I didn't know what to put on the Port rangeand Source by trying to add a new Custom TCP rule for my default security group. So I ended following this tutorial using mysqldump but I have the same connection problem as using >mysql
Any help would be really appreciated!

Databse Connection error By Giving Specific IP address-Drupal

I have created database and user and give all the privilege to the user.When i give the IP as Database host.It will show the following errors.Giving hostname as localhost it will work fine.
I am using phpmyadmin 3.3.2...
The error message is given below.
Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to MySQL server on '192.168.85.10' (111)
It seems that the IP address you use is your "external" IP and not the IP localhost would resolve to, which is most of the time your loopback: 127.0.0.1.
So if you are trying to connect from the same computer as the database is running you should use 127.0.0.1 as the IP address.
If you are trying to connect to your database from another computer on the network, you should enable MySQL remote access in your my.conf (MySQL config file). Because by default MySQL disables remote incoming connections.
You do this by setting the "bind-address" line to your real (external) server IP as such:
bind-address = 192.168.xx.xx (assuming its on your local network)
Or put the bind-address in comment.
Also make sure that the skip-networking option is commented as such:
#skip-networking
And then restart your MySQL server.
Now also make sure that your MySQL users are also allowed to connect from locations other then "#localhost".
I hope this helps!
Cheers,
Timusan

Resources