Jump to content


Photo

connection to postgresql database

Error

  • Please log in to reply
15 replies to this topic

#1 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 09 December 2019 - 07:45 PM

I have the error of not being able to connect to the database, locally I connect but from my server I have not been able to, I have read about it and they tell me that it is problems of php extensions with postgresql

Edited by urano68, 09 December 2019 - 07:46 PM.


#2 vanisk

vanisk

    Rank II Member

  • Members
  • PipPip
  • 67 posts
  • Gender:Male
  • Location:Tamil Nadu, India

Posted 09 December 2019 - 07:56 PM

Please mention

 

1)Server Name

2)PHP version

3)PHP extensions to be installed


2B | !2B

 

 

 

 


#3 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 09 December 2019 - 07:59 PM

1 Johnny
2 7.3
3 php_pdo_pgsql - php_pgsql

#4 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 09 December 2019 - 08:07 PM


this is the error that shows:
Fatal error: Uncaught Error: Call to undefined function pg_connect() in /home/urano68/public_html/servicios.digitales/configuracion/conexion.php:2

#5 Luigi123

Luigi123

    Rank X Member

  • Moderators
  • 2,032 posts
  • Gender:Male
  • Location:Winnipeg, Manitoba, Canada

Posted 09 December 2019 - 11:43 PM

This support request is being escalated to our root admin.
Posted ImagePosted ImagePosted Image
Posted ImagePosted ImagePosted Image

#6 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 19,663 posts
  • Gender:Male

Posted 10 December 2019 - 03:26 AM

The extension pgsql has been installed on Johnny's php 7.3.

#7 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 10 December 2019 - 03:13 PM


Good morning, thank you very much come and check and the error does not come out. Very kind for the attention  :D  :D  :D



#8 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 10 December 2019 - 04:50 PM

Good morning, thank you very much come and check and the error does not come out. Very kind for the attention  :D  :D  :D



#9 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 10 December 2019 - 05:02 PM

Now I have problems with this error:

 

Host= localhost; DBname= taxis; User= postgres; Password= postgres

 

 

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "postgres" in /home/urano68/public_html/servicios.digitales/configuracion/conexion.php on line 3

 

I think that for to fix this error open PostgreSQL client authentication configuration file pg_hba.conf

 

By default Postgresql uses IDENT-based authentication. All you have to do is allow username and password based authentication for your network or webserver. IDENT will never allow you to login via -U and -W options. Append following to allow login via localhost only:

 

local    all    all    trust
host    all    127.0.0.1/32    trust



#10 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 19,663 posts
  • Gender:Male

Posted 11 December 2019 - 06:30 AM

Your user isn't postgres, it is the user you create through cpanel that starts with urano68_.

#11 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 13 December 2019 - 04:18 PM

Annex I send you what is in the PostgreSql cPanel, database and user database and the php code of my application, thanks for what you can help me.

 

User:
                                                              urano68_postgres                                                          
Database:
                                                                      urano68_taxis                                                              
 

php

<?php

$sis_titulo="";

$sis_estilo="";

$sis_charset="utf-8";

$sis_oficina="001";

$sis_proyecto="";

$bd_servidor="localhost";

$bd_puerto="5432";

$bd_nombre="taxis";

$bd_usuario="urano68_postgres";

$bd_clave="postgres";

?>

Edited by urano68, 13 December 2019 - 04:23 PM.


#12 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 13 December 2019 - 04:41 PM

Thank You Krydos

 

I could solve the error, it is because of the prefix that you have to put to the database and the user, with the data that you wrote to me, I did it with both parameters and I already have access to the database, thank you very much for your help and patience

 

 

 
 
I could solve the error, it is because of the prefix that you have to put to the database and the user, with the data that you wrote to me, I did it with both parameters and I already have access to the database, thank you very much for your help and patience

Edited by urano68, 13 December 2019 - 04:41 PM.


#13 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 13 December 2019 - 10:37 PM

Again, here, I already connected to the database, but now I have an error wanting to inert data in a table

 

Warning: pg_query(): Query failed: ERROR: permission denied for relation usuarios

 

I hope you can help me, I don't know if I can solve that error with the phpPgadmin or that is done from the server?



#14 Guest_pooks_*

Guest_pooks_*
  • Guests

Posted 13 December 2019 - 10:41 PM

Again, here, I already connected to the database, but now I have an error wanting to inert data in a table

 

Warning: pg_query(): Query failed: ERROR: permission denied for relation usuarios

 

I hope you can help me, I don't know if I can solve that error with the phpPgadmin or that is done from the server?

 

Next time, don't keep making posts. Edit your previous post instead.

 

If you need to bump, make sure 24 hours have passed first.

 

As for your isssue, it seems like a user permission situation.

 

Does your user have all permissions?



#15 urano68

urano68

    Rank I Member

  • Members
  • Pip
  • 12 posts

Posted 13 December 2019 - 10:59 PM

Sorry for the other post, I'm new to this. If the error was of permisology and I could solve it by phpPgadmin, thanks again


Edited by urano68, 13 December 2019 - 10:59 PM.






Also tagged with one or more of these keywords: Error

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users