Forum

Connection to db vi...
 
Notifications
Retirer tout

Connection to db via Unix Socket?

4 Posts
2 Utilisateurs
0 Reactions
3,285 Vu
(@verncon)
Posts: 41
Active Member
Début du sujet
 
[#2432]

Hi,

Is it possible to connect via unix socket to PGSQL, from Projeqtor?

Cheers,
Verncon.


 
Posté : 12 Juil AM 02:077
(@verncon)
Posts: 41
Active Member
Début du sujet
 

Got it sorted, all is OK.


 
Posté : 12 Juil PM 15:077
(@babynus)
Posts: 14952
Membre Admin
 

Hi, VERNCon

If you found a trick, please share with the community, it could help someone.
Thanks in advance.


 
Posté : 12 Juil PM 16:077
(@verncon)
Posts: 41
Active Member
Début du sujet
 

Hi,
It was much simpler than I expected....
In the parameters.php file, at $paramDbHost value, all I needed to do was enter the Unix Sockets directory for the connection.
In my case (Fedora with PGSQL), I entered "/var/run/postgresql/" and re-started the httpd Service.

You need to have the database listening on the appropriate Unix Sockets - the default for PGSQL is /var/run/postgresql/ and /tmp.

The code used in this software is obviously much "nicer" than others, as I did the "usual" and I replaced the / 's with %2f, but then it complained that it could not parse the value.
I tried the straight text string including the forward-slash, it happily accepted it and the database connection came straight up. You still need to correctly edit the pg_hba.conf file correctly to control the access.

Cheers,
Verncon.


 
Posté : 12 Juil PM 20:077
Share:
Retour en haut