Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm saying PostgreSQL database does not exist?

I am able to connect to the protomolecule database with these exact same credentials through a PHP script. Trying to set it up in PhpStorm fails as you can see in the picture.

If I change the protomolecule database to the default postgres database it connects just fine in PhpStorm. I can't figure out why the user can only connect to postgres and nothing else.

I've tried setting up a new user and new databases to no avail.

PhpStorm Data Sources and Drivers window

Edit: Added the working PHP script settings below, as requested.

array(
    'database' => 'protomolecule',
    'driver' => 'Pgsql',
    'hostname' => 'localhost',
    'username' => 'postgres',
    'password' => 'xxxxxxxxxxxxx',
    'port' => '5432'
)
like image 731
Glyph Avatar asked Oct 29 '22 15:10

Glyph


2 Answers

In the image there is an url given. It states that this "overrides settings above". In the url there is no username/password. Can you try adding username (and maybe password too) to the url - or empty the url field.

like image 93
Seb Avatar answered Nov 09 '22 14:11

Seb


Check if

  1. You can view your postgres database from a dashboard (like phpmyadmin)
  2. did you check your permissions on the table? normally if in the code it connects with no problems, then it should work in phpstorm. But your url seems strange,try changing it with localhost:5432/protomolecule
like image 20
Fedeco Avatar answered Nov 09 '22 15:11

Fedeco