You can follow these steps:
- Update the package manager:
sqlsudo apt update
- Install PostgreSQL:
sudo apt install postgresql postgresql-contrib
- Once the installation is complete, you can check the status of the PostgreSQL service:
luasudo systemctl status postgresql
- If the service is not running, you can start it with the following command:
sqlsudo systemctl start postgresql
- By default, PostgreSQL creates a user named "postgres". To create a new user, you can use the following command:
csssudo -u postgres createuser --interactive
- To create a new database, you can use the following command:
csssudo -u postgres createdb [database name]
That's it! You have successfully installed PostgreSQL on your Linux-based system.
No comments:
Post a Comment