Tag:sql lib mac sq boot style data connection iv
Because you want to use the recommended rails-template. Need to use Postgres. And initializes a user postgres, the password is postgres. (e.g. $ createuser -d postgres )
Need to buy a copy of the relevant database book to read. Briefly look at the simplified instructions for use on the Internet: (original link)
I have used the brew install PostgreSQL installation and have set up boot brew services start PostgreSQL
Go to console PostgreSQL:
Psql
Use \l to list so the database. There is already a database with the same name as the user, Postgres database
I installed the original text operation, entered the command, but did not have any hint. Finally see \l, no change, I think it is my operation in which position error.
From the new setting password to Postgres
chentianwei=# CREATE USER postgres with PASSWORD ' Postgres '
chentianwei-# \lchentianwei-# CREATE DATABASE exampledb OWNER postgreschentianwei-# \lchentianwei-# GRANT all privileges On DATABASE Exampledb to Postgres
Then use psql-u postgres-d postgres
There is no change to the database entered \l listed in the database entry.
List of commands:
\password: Sets the password for the currently logged on user
\h: View an explanation of the SQL command, such as \h Select.
\?: View the list of PSQL commands. \l: Lists all databases.
\c [database_name]: Connect to a different database.
\d: Lists all tables for the current database.
\d [table_name]: Lists the structure of a table.
\DU: Lists all users.
\e: Opens a text editor. \conninfo: Lists the current database and connection information.
\password [user]: Modify user password
\q: Exit
Install configuration on Mac and easy to use PostgreSQL (still not understand)