Therefore, you can only connect to the PostgreSQL server from within the Ubuntu server where PostgreSQL is installed. ALTER USER postgres PASSWORD 'myPassword' PostgreSQL Remote Connection Configurationīy default, the PostgreSQL server is accessible only on the loopback interface (127.0.0.1) on port 5432 and through the Unix socket. Replace myPassword with a password of your choice. Now, we have to change the postgres user’s password so that we can allow remote PostgreSQL connection using password authentication.Įxecute the following query to set a password. Let’s check the version of PostgreSQL using the following command. Initialize the server by running the command: sudo service postgresql-9.3 initdb Start the server by running the command: sudo service postgresql-9.3 start. Step 1: Updating system packages If you haven’t updated your system packages recently, update your system packages first. So you can use an apt packaging system to install PostgreSQL. When you install PostgreSQL, the psql client also gets installed.Įxecute the following command to connect to the server. PostgreSQL packages are available for installation and configuration in the Ubuntu repositories. You can connect to the PostgreSQL server using the psql client sudo systemctl status postgresql Connect to PostgreSQL & Change Password How to Install Postgres on Ubuntu Step 1 Enable the PostgreSQL apt repository Step 2 Install PostgreSQL on Ubuntu Step 3 Connect to PostgreSQL Step 4. Lets validate PostgreSQL by checking the service status. If you want to install a specific version of PostgreSQL, you can search for the available versions from here and use the version with the install command as shown below. Install the latest version of PostgreSQL sudo apt-get -y install postgresql Sudo sh -c 'echo "deb $(lsb_release -cs)-pgdg main" > /etc/apt//pgdg.list' It is always better to download the latest version available in the official PostgreSQL Ubuntu repository.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |