Then, you can grant privileges to mydb_user on the newly created database. CREATE DATABASE mydb WITH OWNER mydb_user Next, create a database with the below command. CREATE USER mydb_user WITH ENCRYPTED PASSWORD 'password' OR postgres=# \password postgres Create PostgreSQL Database and Userįirst, create a database user with the below command. On psql shell, run the below command to change the postgres user (Database admin password. To manage the PostgreSQL database, you will need to log in as a postgres (Linux user) and then have to access the database shell using the psql command. READ: netstat command not found on Debian – Quick Fix Access PostgreSQL You can now use the netstat command to confirm if PostgreSQL is listening on port 5432 or not. So, we will configure PostgreSQL to listen to the system IP address. Configure PostgreSQL Serverīy default, PostgreSQL listens on the localhost (127.0.0.1), which you may not always want as external applications may need to connect to the database. Sep 15 14:19:30 systemd: Started PostgreSQL RDBMS. Sep 15 14:19:30 systemd: Starting PostgreSQL RDBMS. Main PID: 3759 (code=exited, status=0/SUCCESS) Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset: enabled)Īctive: active (exited) since Wed 14:19:30 CDT 42s ago You can check the status of the service with the below command. # PostgreSQL 13īy now, the PostgreSQL service will be up and running. Then, install PostgreSQL using the below command based on the PostgreSQL version you want to install. Once you have added the PostgreSQL repository, run the following command to update the repository index. # Debian 11Įcho "deb bullseye-pgdg main" | sudo tee /etc/apt//postgresql.listĮcho "deb buster-pgdg main" | sudo tee /etc/apt//postgresql.list # Debian 11Ĭurl -fsSL | sudo gpg -dearmor -o /usr/share/keyrings/postgresql-keyring.gpgįinally, add the PostgreSQL repository information to the system with the below command. sudo apt install -y curl apt-transport-https Then, install the HTTPS support for apt to get packages from the internet. PostgreSQL publishes packages for Debian operating system through their dedicated repository, and the packages in their repository are fresher than those available in the OS repository.įirst, update the repository index using the apt command sudo apt update In this post, we will see how to install PostgreSQL on Debian 11 / Debian 10. PostgreSQL is released under the PostgreSQL License and is available for Linux, Microsoft Windows, FreeBSD, OpenBSD, and macOS. It has more than 30 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and performance. PostgreSQL (often abbreviated as Postgres) is an object-relational database management system (ORDBMS) emphasizing extensibility and standards compliance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |