Martin.xu

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

[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

posted on 2018-08-19 22:17  Martin.xu  阅读(4357)  评论(0编辑  收藏  举报