WAMP server's Adminer login: "Access denied" - for all users - wampserver

I downloaded WAMPServer 3.2.0 and installed it on Windows 10.
I started PHPMyAdmin, logged in to the mysql database, and
changed the empty password of 'root' user to a real password.
I Started the Adminer 4.7.5 and tried to log in the mysql
database, with the 'root' user, but failed.
"Access denied for user 'root'#'localhost' (using password: YES)".
The same thing happens with any other users, too.
What can I do to solve this?

Problem solved:
Right-click on WampServer icon on the system tray, select "Tools" and select "Invert Default DBMS MariaDB <==> MySQL". WampServer restarts, and after this I can login into the "mysql" database with any user.

As of WAMPServer 3 you get MySQL and mariaDB installed.
So they cannot both run on port 3306, in fact mariadb will listen on 3307 and MySQL will listen on 3308 by default.
So when you run adminer you have to tell it which database server instance you want to access by specifying the port number the database is listening on. You can do this by adding the port to the host Server Name field on the login like so:

Set a password MySQL if empty
run
ALTER USER 'userName'#'localhost' IDENTIFIED BY 'New-Password-Here';
try to log in adminer as you set

Related

PG::ConnectionBad (FATAL: pg_hba.conf rejects connection for host "172.17.0.1", user "XXX", database "XXX", SSL off ):

I am using postgres:9.4.5 image for my project using dockers on digitalocean droplet.
Following is the docker-compose.yml configurations for postgres.
db:
# use the preferred version of the official Postgres image
# see https://hub.docker.com/_/postgres/
build: .
# build with a different Dockerfile
dockerfile: Dockerfile-pg
# persist the database between containers by storing it in a volume
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
POSTGRES_USER: XXX
Inside Dockerfile-pg i have following configurations
FROM postgres:9.4.5
EXPOSE 5432
When, I build and run images I get the following error
PG::ConnectionBad (FATAL: pg_hba.conf rejects connection for host "172.17.0.1", user "XXX", database "XXX", SSL off ):
I already set the following line to allow all connections in postgresql.conf file
listen_addresses = '*'
inside pg_hba.conf file I also set up following line to allow for all connections
host all all 0.0.0.0/0 trust
I also set the local environment with the same configurations on my local system. Everything is working fine on my local machine. Everything was also working fine on server on digitalocean few days back.
I don't know why it is trying to connect with this IP 172.17.0.1. I have set up HOST_IP for postgres which is my droplet ip.
I don't know why I am getting this error. I tried everything to fix it.
Please help me!
Check you pg_hba.conf file.
You might have options that you haven't added such as
host all pgdbadm 0.0.0.0/0 md5
This pgdbadm is known for account created by crypto-mining hackers.
Add ?ssl=true&sslmode=require to your datasourse.url. E.g.
url: ${db.url:jdbc:postgresql://${db.host:localhost}:${db.port:5432}/${db.name:my_db}}?ssl=true&sslmode=require

Access denied for user 'root'#'localhost' (using password: NO) in configuration process

This happened in my configuration process (3/4). I think this is because my database port is 3307 and not 3306. However, version 2.0.1 doesn't ask for port details. If this is the reason my configuration has paused, how do I change this?

PG Restore function not working on localhost

I'm trying to restore a backup to my localhost machine to review the data - so that I can actually make sure the backup is working. I'm using Heroku, postgres, and rails.
I clean installed the app, so there is no data in the localhost database. I ran db:reset, and db:migrate.
Here is the string I'm trying to use for pg_restore:
pg_restore --verbose --clean --no-acl --no-owner -h localhost -p 3000 -U ian -d backup_production latest.dump
The error I receive says:
"connection to database "backup_production" failed: server closed the connection unexpectedly"
I've never had to do this before, so any help would be appreciated. I assume that development is what localhost uses (instead of test or production)?
I'm not sure what I'm missing, but I'll answer any question you may have.
Thanks a lot.
edit,. Here is a question, for this database string I assumed that I need to to use all the localhost information, because I created a backup using heroku capture/download. Am I wrong in that assumption? Should I instead be using the database name and port, etc, from the heroku credentials?
Turns out, I shouldn't have added the port. Removing -p 3000 , made this command work.
Try this
Edit the postgre configuration file typing in terminal
sudo gedit /etc/postgresql/POSTGRE_VERSION/main/pg_hba.conf
Then change your configuration to this
# Database administrative login by Unix domain socket
local all all trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
Restart your postgre server
sudo /etc/init.d/postgresql restart
This should be the solution to access without password

How to connect to localhost PostgreSQL on Mac using PSequel GUI?

I followed this tutorial to install PG on my Mac. It's my first time using PG locally. I used Sqlite a lot in my Rails projects before this.
I found this PSequel GUI app and I just installed it. But I've no idea how to connect to my localhost PostgreSQL databases.
What is my:
Host/Socket?
Port? (I use localhost:3000 to test my Rails app locally)
User?
Password?
Database?
Thanks.
localhost:3000 is the default url of webrick webserver. By default postgre SQL service connection is to localhost on 5432 post.
$ cat /etc/services | grep postgres
postgres 5432/tcp # POSTGRES
postgres 5432/udp # POSTGRES
That is for unix like systems. And I have postgres server listening on 5432 port.
$ netstat -l --numeric-ports |grep 5432
tcp 0 0 localhost.localdomain:5432 *:*
unix 2 [ ACC ] STREAM LISTENING 11396 /tmp/.s.PGSQL.5432
So the fields will have the following default values:
Host/Socket
localhost
For test/development purposes most people use local server to connect to db.
Port
5432
That is just postgres server (not webserver) connection port. To validate just list and grep the postgres configuration file, like follows:
# cat /var/lib/pgsql/data/postgresql.conf | grep port
#port = 5432 # (change requires restart)
Here it is commented out, so default values are applied.
User
you are, but you must create the user role before connection as of the postgres user with createuser or psql terminal utilities.
Password
When you will create the user just leave password empty. So you be able then stay the field empty in the form.
Database
That is the database name. Create it with the command if needed.
You should enter below detail for configuration:
Host/Socket? - localhost
Port? - 5432
User? - DB user(My case its: postgres)
Password? - Password for above user
Database? - DB name of your project
You can see screenshot in this site: http://www.psequel.com/

create connection to localhost postgres server

I am creating a rails app and want to use postgresql. I have installed pgadmin, postgres sever on Ubuntu 14.04. I've tried creating a connection through pgAdmin but not able to create it. I am unable to configure pgadmin to create a connection to pg server.
I've tried editing the /etc/postgresql/9.3/main/pg_hba.conf file, but I get the following error:
FATAL: Peer authentication failed for user "postgres"
here is 'pg_hba.conf' file
Database administrative login by Unix domain socket
local all postgres peer
TYPE DATABASE USER ADDRESS METHOD
"local" is for Unix domain socket connections only
local all all peer
IPv4 local connections:
host all all 127.0.0.1/32 md5
IPv6 local connections:
host all all ::1/128 md5
Allow replication connections from localhost, by a user with the
replication privilege.
local replication postgres peer
host replication postgres 127.0.0.1/32 md5
host replication postgres ::1/128 md5
I would be grateful if someone could provide some help with configuration.
This is a VERY common error when you first install postgres, it defaults to using "postgres" as the user. You need to add your current user as a user in Postgres: Postgresql: password authentication failed for user "postgres"
First, you can reset the password for postgres:
sudo -u postgres psql
ALTER USER postgres PASSWORD 'newPassword';
But I would also/instead create a user for your current account (As a Superuser):
CREATE ROLE user_name WITH LOGIN SUPERUSER CREATEDB CREATEROLE REPLICATION;
Edit: The above command must be run from psql, so doing "sudo -u postgres psql" to access postgres is required either way.
Source: https://www.digitalocean.com/community/tutorials/how-to-use-roles-and-manage-grant-permissions-in-postgresql-on-a-vps--2
you can also try connecting through pgAdmin with the following configuration..

Resources