MAC brew 安装 Postgresql

 

[Postgresql]

安装:
brew install postgresql -v

初始化:
initdb /usr/local/var/postgres -E utf8

设置开机启动:
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

启动:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

关闭:
pg_ctl -D /usr/local/var/postgres stop -s -m fast

创建用户:
createuser username -P
#Enter
password for new role:
#Enter
it again:

创建数据库:
createdb dbname -O username -E UTF8 -e

连接数据库:
psql -U username -d dbname -h 127.0.0.1

显示已创建的数据库:
\l

不进Postgresql在终端里直接查看:
psql -l

连接数据库:
\c dbname

显示数据库表:
\d

创建一个名为 test 的表:
CREATE TABLE test(id int, text VARCHAR(50));

或者利用 dropdb 指令,在终端上删除数据库:
dropdb -U user dbname

 


sudo find / -iname "php_gd2.dll"

[apache]
/private/etc/apache2

Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All

sudo apachectl start

[php]
/etc/php.ini

转载于:https://www.cnblogs.com/xu360/articles/9502964.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值