Laravel 5 + Postgresql Connection - postgresql

I have some problem in Postgre SQL, i can't connect my project Laravel 5 into Postgre SQL(i'm using PG Admin III), of course i remember the password in the first time i installed the Postgresql. but i think the problem is default username for database PostgreSQL, i try use "root",and "postgres" but both is failed. maybe someone know a default username for postgresql
PS: i've already configuring default into pgsql in database.php file and .env file
note: the error is (i tried in tinker laravel) "PDO exception with message could not find any driver"

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.

postgresql pg library taking windows username instead of postgresql

i am using pg lib in strapi application, where initially it creates postgres connection using correct postgresql username(postgres), database name(strapi_db) and password(postgres) but after login it changed it to connect using my windows 10 username(rayappan.a, and database as rayappan.a). it seems strange to me because i never configured anywhere to use my windows credentials for POSTGRESQL connection. please any one tell me how to fix username connection issue
Regards,
Rayappan Antoniraj
Take a look into https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING . It states that username:
Defaults to be the same as the operating system name of the user running the application."
The database name:
Defaults to be the same as the user name.
So it seems a new connection with parameters not set is made.

"Null value for 'password'" - PostgreSQL in DataGrip

I have browsed the web but didn't find any answers/solution to my problem, so i hope somebody here can help me:
I have downloaded DataGrip because i wanted to replace pgAdmin 4. When i try to create a PostgreSQL data source and host it locally, i get the following error: "Null value for 'password'". In pgAdmin 4 i do remember creating a password to access my local database when i first set it up, and it worked fine. However, i don't remember creating a password when installing DataGrip. Is there some default password that im not aware of? And what should be written under "User"?
DataGrip can only connect to the server which already exists (and therefore has a password). "Data source" is the term of DataGrip.
In other words, you need to already have a working database on the server with the known credentials.

Password authentication fails when trying to connect to postgresql from clojure with jdbc

I'm learning web development in Clojure and I'm not at all an expert in either PostgreSQL or JDBC.
I'm going through the "Web development with Clojure" book and I'm stuck because I cannot connect to a PostgreSQL database, although I believe I have followed the tutorial step by step.
I connected to psql with
sudo -u postgres psql
Then I created an admin user with password 'admin'
postgres=# CREATE USER admin WITH PASSWORD 'admin';
CREATE ROLE
Then I created a database named reporting :
postgres=# CREATE DATABASE reporting OWNER admin;
CREATE DATABASE
No complaints so far.
Then from my clojure code, I attempt to connect to the database and create a table :
(ns reporting-example.models.db
(:require [clojure.java.jdbc :as sql]))
;defining the db connection
(def db
{:subprotocol "postgresql"
:subname "//localhost/reporting"
:user "admin"
:password "admin"})
;function for creating an 'employee' table
(defn create-employee-table []
(sql/create-table :employee
[:name "varchar(50)"]
[:occupation "varchar(50)"]
[:place "varchar(50)"]
[:country "varchar(50)"])
)
; then trying to actually create the table, here's the part that breaks with an exception :
(sql/with-connection db
(create-employee-table))
And I'm getting an ugly :
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "admin"
Which does not make sense to me, the credentials seem fine.
I tried the above code from both the Counterclockwise REPL and the Leiningen REPL. I'm on Ubuntu 13.10, if that matters.
Could someone explain to me what I am doing wrong here?
Thanks in advance!
Since you can't connect with psql using the same settings there are really three possibilities:
wrong/typo'd password
wrong/typo'd username
you are not connecting to the same server as you created the account on.
To check the latter, connect however you did to create the account and then run
show port;
Make sure it is the same as what you specify in your app. That isn't perfect - two pg instances can share a port if one isn't listening on TCP/IP and has a different socket directory - but it is a good first test.
You should also examine the PostgreSQL server error logs, as they may contain more detailed information about the nature of the authentication failure.
If you have not tried this already, review your pg_hba.conf file. It will be named something like
/etc/postgresql/9.6/main/pg_hba.conf (Ubuntu 16.04)
/var/lib/pgsql/9.3/data/pg_hba.conf (Fedora 20);
You may have to use find / -name pg_hba.conf to locate it.
At the bottom of the file, change the METHOD values to trust for local testing (see postgres docs for full information). Restart postgres to ensure everything is started clean and the new params are read:
> sudo systemctl restart postgresql # ubuntu
Hopefully this will cure your woes. It solved my problems on Ubuntu/Fedora.

Can't connect to local Firebird with ISQL

I'm trying to setup a local firebird instance to test against but am unable to connect to it with even ISQL. I have tried to following by following the quick start guide here:
CONNECT ..\examples\empbuild\employee.fdb user SYSDBA password masterkey;
Which resulted in:
Statement failed, SQLSTATE = 08001
unavailable database
After some searching I tried modifying that to:
CONNECT "localhost:C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\employee.fdb" user SYSDBA password masterkey;
Which resulted in:
Statement failed, SQLSTATE = 28000
cannot attach to password database
After confirming I had the right directory path I decided to give on on connecting for now and try creating a new DB:
SQL>CREATE DATABASE 'C:\data\test.fdb' page_size 8192
CON>user 'SYSDBA' password 'masterkey';
Which also gave me the error:
Statement failed, SQLSTATE = 08001
unavailable database
Are there any common pitfalls I might be hitting? I've also tried the commands above both with and without the firebird service running. Also is there a detailed reference on the SQLSTATE codes?
As already mentioned in my comments the problem is caused by running the Firebird server as an application. Firebird has its password database (security2.fdb) in C:\Program Files\Firebird\Firebird_2_5. As this database is (almost, but not entirely) a normal Firebird database, the server requires write access to this database (for the transactions, etc).
By default (with UAC) users do not have write access to the password database, so this requires elevation to Administrator. So access to Firebird requires that you either run the application as a service with sufficient rights (eg as done by the default installer), or when running the server as application to run it 'As administrator'. Another option is to not install it in Program Files.
This BTW applies double when accessing the example employee database as this database file is also located in the Program Files folder.
This is for macOS/OSX (mine is 10.15) firebird ver 2.5 users.
The installation process here does not ask for a sysdba password. Which means: the security database 'security2.fdb' does not exist after a new installation.
This seems to be intentionally for security reasons since > ver 2.5.
To create one, we use the demo database as a helper:
open sql as su: >sudo isql (we don't have user rights on dir)
Connect to a existing db:
sql>connect
"/Library/Frameworks/Firebird.framework/Resources/examples/empbuild/employee.fdb
" user 'SYSDBA' password 'masterkey';
Now we created the missing file 'security2.fdb' in the folder:
"/Library/Frameworks/Firebird.framework/Resources/English.lproj/var/"
(jro)