[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