By default, the new database will be created by cloning the standard system database template1. To create a database , you must be a superuser or have the special CREATEDB privilege. The role name of the user who will own the new database , or DEFAULT to use the default (namely, the user executing the command).
.jpg)
Once you have created another database you will want to. To create a normal user and an associated database you need to type the following commands. These instructions are intended for creating a MySQL database on Linux via the command line.
I’ll be working from a Liquid Web Core Managed CentOS server, and I’ll be logged in as root. It appears that for psql , tab does not suggest a list of user names on the command line when the cursor is after a database name. If does produces that list however, when the cursor is after -U. Step 2) Press enter five times to connect to the DB.

Alternatively, input can be from a file. In addition, it provides a number of meta-commands and various shell-like features to facilitate writing. Before restoring a database , you need to terminate all connections to that database and prepare the backup file.
Another option is to directly connect to the schema. Example: sudo -u postgres psql -d my_ database _name. How do I list all databases and tables using psql ?

