![]() The shell commands to run would be these: $ createuser -P bloggerĮnter password for the new role: ******** To support a given application, you often create a new role and database to match. (Must be superuser to alter passwords of superusers) CREATE ROLE niceusername with LOGIN If the user issuing the command is a superuser, the current password will not be asked. To avoid this, use the \password command to set the user password. psql_history in the user's home directory and may as well be logged to the PostgreSQL database server log, thus exposing the password. ![]() The problem with that is that queries typed into the psql console get saved in a history file. ![]() Here we make one called niceusername and give it a password very-strong-password CREATE ROLE niceusername with PASSWORD 'very-strong-password' LOGIN You should instead create a user with lower levels of privileges. Generally you should avoid using the default database role (often postgres) in your application. Where option can be: SUPERUSER | NOSUPERUSER | CREATEDB | NOCREATEDB | CREATEROLE | NOCREATEROLE | CREATEUSER | NOCREATEUSER | INHERIT | NOINHERIT | LOGIN | NOLOGIN | CONNECTION LIMIT connlimit | PASSWORD 'password' | VALID UNTIL 'timestamp' | IN ROLE role_name | IN GROUP role_name | ROLE role_name | ADMIN role_name | USER role_name | SYSID uid ![]() To create a database, type the following command.CREATE ROLE name option ]ĬREATE USER name option ] You can now run commands as the PostgreSQL superuser. To create a PostgreSQL database, follow these steps:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |