Problems with postgres database in redmine after change in password - postgresql

First, I'm a total newbie and I guess that's why this error occurred in the first place.
A colleague of mine stopped working and so I had to take over administrative stuff as the redmine we use and making backups.
So I wanted to schedule these backups automatically. Somewhere on the way I changed /etc/postgresql/9.1/main/pg_hba.conf for user postgres (that's the one for the redmine database.
from local all postgress peer to local all postgress trust so I could run a shell program in crontab. This worked but then redmine doesn't work anymore. I get this:
FATAL: password authentication failed for user "postgres" FATAL:
password authentication failed for user "postgres" (PG::Error)
On this the error site for redmine. I changed everything back and restarted everything, but it did't work.
Then I used an older backup to restore but still.
So, now I have no idea whats wrong. Maybe someone can help me.
Thanks.
Barbara

I think it is because I've changed the password of the postgres user in ubuntu. I did not know at the moment that they are connected. I always got a password promt but I didn't know it (my colleague at least didn't tell me one) I've tried to change it in the data base as well with
ALTER USER Postgres WITH PASSWORD 'newpassword';
Would it be enough to reinstall the database and use an old backup?

Related

PostgreSQL with DBeaver, password?

I am a student. I've created a Rails/React project using PostgreSQL. I downloaded DBeaver so that I can view my database but cannot get DBeaver to connect, and have spent a couple of hours trying to solve this.
I attempt to set up DBeaver for PostgreSQL, click "New Connection," leave all defaults set and click "Finish" when I'm met with the following error:
The server requested password-based authentication, but no password was provided.
I am pretty certain that I never entered a password for this database. I saw it suggested that the default password is "postgres" but I tried that with no success. In terminal when I run "psql --list" I can see my DB's name and I can see that I am the owner.
I am running a Debian distro, if that makes any difference. I installed DBrowser through Synaptic. I'd appreciate any assistance.

Database backup not working using database manager

I'd like to backup a db today through localhost:8069/web/database/manager
, but the button return nothing while clicking the button.
Terminal show no error there.
Also invalid for duplicate, delete, create database,restore database and set Master password except link of existed db.
see pic as below:
the problem emerged since I deployed odoo12.
I can directly backup through pgAdmin4.
but I still want to know what happened.
My version of pgsql is 9.6 for odoo10 and odoo11.
It worked smoothly before I deployed odoo12
I found it's a stupid question.
the reason is that I connect to wrong db_host:
my conf set db_host as 127.0.0.1 but connect to localhost.
keep this topic for who make same mistake

Remove all postgresql users/completely delete

As I attempt to create my initial user account on postgresql, I am prompted for my password, though when I enter the correct one I recieve:
createdb: could not connect to database template1: FATAL: password authentication failed for user "thomasmurphy"
I am installing through brew. My thought is that somewhere along the line I've set a password different from my system one. How do I remove all users so I can reset this pass.
I get my permission denied even if I su to postgres. I have gone through every thread on stackoverflow on this issue, and have tried:
*modifying my pg hba_conf
*updating my gems and developer tools
*running brew doctor
*reinstalling postgres
*all the other command line ideas through the thread
My situation seems to not have cropped up before, which convinces me I've set a password at some point that is now tripping all of my attempts. Adding to this theory is that I have a postgres setup on my work computer, also on mavericks, function perfectly.
Note that unless you changed defaults, homebrew installs Postgres with you as the superuser rather than as the postgres user. The issue might be that you're trying to use postgres "as normal" whereas it doesn't need or event want the usual postgres user references.
You see the list of users on the system using cat /etc/passwd, and you can change an arbitrary password by running chpass as root.

What is the default username and password for PostgreSQL?

I am working on an open source application that has PostgreSQL as its default DBMS. Now when I install it on my system, its configuration is so that PostgreSQL also gets installed with it.
My problem is with getting access to the installed PostgreSQL database. The database that gets created during installation is named iviewdb.
I read at many forums that the default superuser is postgres, but when I try to get access to the database using this username through a command prompt, it prompts me for password that I don't have.
I wanted to know from where in the PostgreSQL installation directory
the default username and password with the port number to access the database is stored. I have even tried changing the pg_hba.conf file, but that creates a problem with the application and it won't start then.
How can I find the password for this database? I am working in a Windows environment.
The password isn't stored in an easily recoverable manner, and if you change the password, the application may not be able to access the database properly. You may find the password in the application settings or documentation, though.
If you decide to risk changing the postgres user's password, stop the application and PostgreSQL service, and then edit pg_hba.conf. Add (or change if it already exists) a line (if it doesn't exist, add it before any other "host...." lines):
host all all 127.0.0.1/32 trust
And restart the PostgreSQL service. That should give you access from localhost, where you could change the postgres user's password, or add yourself another user with the permissions you want. Then set the pg_hba.conf file back the way it was and restart.
I've encountered this similar problem, and I noticed that the default being set for PostgreSQL upon installation in my case is as follows:
username = postgres
password = ' '

How to create a postgresql superuser without a superuser account?

OK...just installed Mountain Lion. First thing I noticed was that my Postgres user account was missing from the login screen. I then verified that my postgres installation was no longer working. So I created a new postgres user account on my Mac and set all the proper permission to get the postgres server to start. It started but immediately the server shutdown. I checked the log files and it said that role "postgres" does not exist.
I can't figure out how to create this user in the db since the db won't allow me to access it without using a superuser account. I tried "createuser postgres" but got the same message, "role 'postgres' does not exist". I don't know what to do at this point.
Found my problem. Somehow my postgres db user did get erased during the upgrade to mountain lion. I was able to log into the db using the same name that I use to log into the system however. Unfortunately, I found that my databases where also removed during the upgrade. I don't know why but the upgrade did effect my postgresql installation. After logging in, I found that the postgres db and the template1 db had no relations to be found. Now to piece my db back together...luckily I'm still in development mode. Note: In the future make db backups prior to upgrading system.