yetanalytics / lrsql

A SQL-based Learning Record Store
https://www.sqllrs.com
Apache License 2.0
91 stars 17 forks source link

No pg_hba.conf entry for host "10.0.1.103", user "Dell", database "lrsql_pg", no encryption #413

Closed ntuan7059 closed 5 months ago

ntuan7059 commented 5 months ago

Hi everyone, when I run the lrsql_pg.exe file, the postgres automatically connects to host "10.0.1.103", user "Dell" and database "lrsql_pg" I want to edit the values ​​of user to "tuannm" and database to "database_tuannm" This is my lrsql.json file { "database": { "dbHost": "0.0.0.0", "dbPort": 5432, "dbName": "database_tuannm", "dbUser": "tuannm", "dbPassword": "123456" }, "connection": { "poolName": "my-pool-name" }, "lrs" : { "adminUserDefault": "admin", "adminPassDefault": "123456", "authorityUrl": "http://mydomain.com" }, "webserver": { "httpHost": "0.0.0.0", "httpPort": 8080, "sslPort": 8443, "allowAllOrigins": true } } It seems like the configs in file is not working with lrsql_pg.exe Many Thanks <3

kelvinqian00 commented 5 months ago

Hello @ntuan7059,

Can you explain more in detail how your Postgres databases are set up? Where did you get the values 10.0.1.103, Dell, and lrsql_pg? Are you trying to connect to Postgres over a network? And are you able to create users and databases in the Postgres system?

To get SQL LRS to work, make sure all of your configuration values in lrsql.json match the corresponding values in Postgres. If you want to set dbUser to tuannm and dbName to database_tuannm, you will have to make sure the user tuannm and the database database_tuannm exist in Postgres. In addition, since the host of your database appears to be 10.0.1.103, you have to change dbHost in lrsql.json to that IP address.

ntuan7059 commented 5 months ago

Hello @kelvinqian00

I setup the Postgres database based on the lrsql documentation, and I created user tuannm as well as database_tuannm according to the documentation and when I run lrsql_pg.exe the command line gives an error: No pg_hba.conf entry for host "10.0.1.103", user "Dell", database "lrsql_pg", no encryption. I am trying to connect to Postgres on my localhost, the 10.0.1.103 is my ip address. I have full permissions to create users and databases in the Postgres system

I have no idea where the Dell user and lrsql_pg database are, because even in Postgres I don't have this username and database. So the lrsql log make me so confuse :(

Ps: I am able to connect to user tuannm and database_tuannm using command: psql -h 10.0.1.103 -U tuannm -d database_tuannm -p 5432. My lrsql.json file is already in C:\lrsql\config

ntuan7059 commented 5 months ago

I have found the solution, it is because of the lrsql.jar file, after install the older version and replace the lrsql.jar file, it seems that the configs in file lrsql.json is working

kelvinqian00 commented 4 months ago

Dear @ntuan7059,

I want to follow up on this issue even though you closed it. We confirmed that the latest version of SQL LRS (v0.7.15) works on Windows, so different SQL LRS versions are not the cause of this problem. To run SQL LRS on Windows, we did the following:

  1. Run Postgres on our local machine (we used the Docker Postgres image)
  2. Set our config file. We set dbHost to 0.0.0.0, and we set dbName, dbUser and dbPassword to the equivalent values in Postgres
  3. Run lrsql_pg.exe