Start postgresql on mac and use brew to install postgresql. 1brewinstallpostgresql then creates a working directory and grants permissions accordingly. 1mkdir-pusrlocalvarpostgres initializes the database file. 1initdbusrlocalvarpostgresdata: Create a log directory. 1mkdir-pusrlocalvar
Start postgresql on mac and use brew to install postgresql. 1 brew install postgresql, create a working directory, and grant permissions accordingly. 1 mkdir-p/usr/local/var/postgres initialize the database file. 1 initdb/usr/local/var/postgres/data to create the log directory. 1 mkdir-p/usr/local/var
Start postgresql on mac
Use brew to install postgresql.
1
Brew install postgresql
Create a working directory and grant permissions accordingly.
1
Mkdir-p/usr/local/var/postgres
Initialize database files.
1
Initdb/usr/local/var/postgres/data
Create a log directory.
1
Mkdir-p/usr/local/var/log/postgres
Specify log output and start.
1
Pg_ctl start-D/usr/local/var/S/data-l/usr/local/var/log/S/log. log
If it is stopped, replace start with stop. If you do not want to specify a data directory every time, you can create an environment variable PGDATA that saves the address.
1
Export PGDATA =/usr/local/var/postgres/data