lbausch / SQLgreyGUI

Web interface for SQLgrey built on Laravel 5
https://lbausch.github.io/SQLgreyGUI/
MIT License
11 stars 4 forks source link

Connect to sqlgrey postgres database not working ? #19

Closed alkar1 closed 7 years ago

alkar1 commented 7 years ago

My .env : `

Database for SQLgreyGUI

If you want to use a single database for both SQLgreyGUI and SQLgrey use only this config block

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=sqlgrey DB_USERNAME=sqlgrey DB_PASSWORD=XXX

Uncomment the following lines if SQLgrey resides in a different database

SQLGREY_DB_CONNECTION=postgresql SQLGREY_DB_HOST=127.0.0.1 SQLGREY_DB_PORT=5432 SQLGREY_DB_DATABASE=sqlgrey SQLGREY_DB_USERNAME=sqlgrey SQLGREY_DB_PASSWORD=XXX ` Log:

`[2017-07-12 11:54:33] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (4)' in /var/www/SQLgreyGUI/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43 Stack trace:

0 /var/www/SQLgreyGUI/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=127....', 'sqlgrey', 'XXX', Array)

`

lbausch commented 7 years ago

Can you connect from the CLI using the provided credentials?

alkar1 commented 7 years ago

Yes , `root@rex:/var/log# psql -h 127.0.0.1 -d sqlgrey -U sqlgrey Hasło użytkownika sqlgrey: psql (9.4.10) Połączenie SSL (protokół: TLSv1.2, szyfrowanie: ECDHE-RSA-AES256-GCM-SHA384, bity: 256, kompresja wyłączone) Wpisz "help" by uzyskać pomoc.

sqlgrey=> sqlgrey=> \dt Lista relacji Schemat | Nazwa | Typ | Właściciel ---------+---------------+--------+------------ public | config | tabela | sqlgrey public | connect | tabela | sqlgrey public | domain_awl | tabela | sqlgrey public | from_awl | tabela | sqlgrey public | optin_domain | tabela | sqlgrey public | optin_email | tabela | sqlgrey public | optout_domain | tabela | sqlgrey public | optout_email | tabela | sqlgrey (8 wierszy)

sqlgrey=>

`

alkar1 commented 7 years ago

I changed sqlgrey database type from postgres to mysql , and all works fine. Thread to close.

lbausch commented 7 years ago

This is a bug. :( If SQLgrey uses a PostgreSQL database you most likely won't be right with specifying mysql. I will release an updated version later.

lbausch commented 7 years ago

Please test latest version.