Regarding psql --username and dbname
jillawar opened this issue · 7 comments
Describe the bug
This doesn't seems to be bug, but :
when I first logged into psql using > psql --username=freecodecamp dbname=postgres , it was successful
but I closed terminal and then tried to do the same i.e to login I type the exact above line.. it is throwing error (attached the image)
Expected behavior
I just want to login to it and start learning the course "Learn Relational Databases by Building a Mario Database".
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- Platform: Windows,
- OS: Windows 10
- Version : 10.0.19043
VSCode (please complete the following information):
- Version : 1.63.2
Node (please complete the following information):
- Version [e.g. 12.4]
Git (please complete the following information):
- Version [e.g. 2.24.1]
Additional context
Add any other context about the problem here.
i closed this has the issue is resolved..
What I did was to restart the same project using URL. and when I started the lessons, it logged in.
Thank you, Sir.
sir, I'd like to reopen the issue..
Cause it appears I can't continue from where I left but have to start over again OR complete the course in one go..
Plesae look into the issue.
Thank you.
Hello Sir,
It appears if we enter the below code (which i found in the course URL), then we need not restart the course, we can continue from where we left by using the starting code : psql --username=freecodecamp dbname=
The code is :
sudo touch ~/pg.log
sudo chmod 777 ~/pg.log
sudo touch ~/queryResults.log
sudo chmod 777 ~/queryResults.log
sudo cp ~/project/.freeCodeCamp/pg_hba.conf /etc/postgresql/12/main/pg_hba.conf
sudo cp ~/project/.freeCodeCamp/postgresql.conf /etc/postgresql/12/main/postgresql.conf
sudo cp ~/project/.freeCodeCamp/.bashrc ~
sudo cp ~/project/.freeCodeCamp/.psqlrc ~
sudo chown -R postgres:postgres /var/lib/postgresql/12/main
sudo service postgresql stop
cd .freeCodeCamp && npm install
sudo service postgresql start
.........
This was amazing to find out, I'm not sure if I can close this issue. Thank you.
Thanks for reporting this @jillawar. If you are having problems with a tutorial, I recommend checking this thread on the freeCodeCamp forum to see if there's an answer there. If you don't see one, you can post a message there and someone may be able to help. If it turns out to be a bug with the tutorial, you (or someone) can then create an issue on the freeCodeCamp repo.
This actually may be something that can be fixed on the CodeRoad end @ShMcK. These are the startup commands. When closing and trying to continue a tutorial, they don't get run. Pretty sure they used to in an earlier version of CodeRoad. For most things, that's not a problem - the files/config still seem to be there from the initial load. A quick test shows that the only one here that is an issue (I believe) is the sudo service postgresql start command. When VSCode gets closed, the service is stopped. One thing I did on another tutorial, that I may do on all of them, is move some of the startup commands to the reset commands area and run that on startup. Then, a user can hit the reset button to restart the service (and setup whatever other config) and continue.
Do you mind closing this issue again @jillawar? I will create a new one that is more focused if needed, or perhaps there's a way I can fix this within the tutorial. Thanks. Oh, and nice job figuring out how to continue 👍
I've closed it.. Yes thank you