Mac下安装Postgresql
目录
homebrew 安装
启动和关闭 postgresql
创建数据库和账户
登陆控制台指令
一.homebrew 安装
安装命令
eternity@TheEternitydeMacBook-Pro ~ % brew install postgresql
eternity@TheEternitydeMacBook-Pro ~ % psql --version
psql (PostgreSQL) 12.3
初始化
initdb /usr/local/var/postgres
如果出现如下提示,可以跳过此步
The files belonging to this database system will be owned by user “eternity”.
This user must also own the server process.
The database cluster will be initialized with locale “zh_CN.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
initdb: could not find suitable text search configuration for locale “zh_CN.UTF-8”
The default text search configuration will be set to “simple”.
Data page checksums are disabled.
initdb: error: directory “/usr/local/var/postgres” exists but is not empty
If you want to create a new database system, ei