[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
