psql not working
I downloaded the slack builds for pd, pd-sql and postgres and when I Run psql in the terminal I receive:
Code:
bash-5.1# psql Code:
bash: /var/lib/pgsql/bin/createdb: No such file or directory |
I've never tried installing postgresql on slackware yet but have you read and followed the READMEs?
Before you can start the server you need to create a postgres user and initialize the database as shown in the setup files. Now you should be able to start the server. You also need to add your user to postgresql via create user so it can create databases. https://slackbuilds.org/repository/1...em/postgresql/ All the postgresql utilities should be linked to /usr/bin. |
Did you see the README.SBo?
It includes: Code:
Before you can run postgresql you'll need to create the |
Quote:
Code:
bash-5.1$ pg_ctl -D /var/lib/pgsql/14/data -l logfile start |
I can confirm if you follow the instructions properly, that postgresql package works well. I've been using postgresql for years and years on Slackware.
|
Quote:
:hattip: |
Quote:
It wants you to run the command as the user postgres, which is done by including the red: Code:
su postgres -c "initdb -D /var/lib/pgsql/14/data --locale=en_US.UTF-8 -A md5 -W" |
Quote:
|
What password are you referring to and what command are you trying to run? If your trying to run initdb in your last post there isn't a password. Use su or login as root then run the posted command. Since your already root su will not ask for passwords.
|
Code:
bash-5.1$ ls |
You need to log in as root on your Slackware system, and then configure the database and its permissions.
|
postgresql passwords are different from user passwords. You need to add the password to your user.
As the postgres user run the command from psql. ALTER ROLE ace WITH PASSWORD 'my_password'; |
Quote:
|
Quote:
So, you should be able to get the initial database set up by doing the following: Code:
su - Code:
Before you can run postgresql you'll need to create the |
Quote:
Code:
bash-5.1$ su Then I ran the following: Code:
bash-5.1# su postgres -c "initdb -D /var/lib/pgsql/14/data2 --locale=en_US.UTF-8 -A md5 -W" Code:
bash-5.1$ ls #!/usr/bin/env sh dropdb sqlzoo createdb sqlzoo psql sqlzoo < data/create_tables.sql |
All times are GMT -5. The time now is 07:00 PM. |