Last active
September 19, 2023 04:10
-
-
Save mazfreelance/9afe62cfb4c69d880ed5bf27cb1260ef to your computer and use it in GitHub Desktop.
setup PostgresSQL database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Access PostgreSQL: Once PostgreSQL is installed, you can access it using the command-line tool psql. | |
# Open your terminal or command prompt and run: | |
psql -U postgres | |
# Create a Database: To create a new database, you can use the following SQL command inside the psql prompt: | |
CREATE DATABASE yourdbname; | |
# Create a User with a Password: You can create a new user and set a password for that user using the following SQL commands: | |
CREATE USER yourusername WITH PASSWORD 'yourpassword'; | |
# Grant Privileges: To allow the new user to access and manage the database you created, | |
# you can grant them privileges using the following SQL command: | |
GRANT ALL PRIVILEGES ON DATABASE "yourdbname" TO "yourusername"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment