How to do it…

To create a new user in the PostgreSQL database server, perform the following steps:

  1. Open Command Prompt by typing cmd into the Windows Start menu search box.
  2. Navigate to the installation directory where you have installed PostgreSQL. More precisely, navigate to the bin folder within the PostgreSQL installation directory, as shown in the following screenshot:
  1. Now, to create a new user testuser, execute the following command:
      createuser.exe --createdb --username postgres --no-createrole 
--pwprompt testuser
  1. Once you enter the preceding command, it will ask you to type a new password for the testuser user. Let's say you are giving a new password testuser123. After typing the password, it will ask you to re-type, and finally, it will ask for you to enter the password again. At this stage, enter the password that you have used for the postgres user, postgres123. After completing the process, you will see the following screenshot:
  1. Now, you can log in to the pgAdmin 4 dashboard to see the newly created user. It will show a screen similar to the following screenshot:

You can see that the new username is on the list under the Login/Group Roles directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset