วันจันทร์ที่ 17 กันยายน พ.ศ. 2555

Command to Make MySQL with utf8 charset

make \
WITH_CHARSET=utf8 \
WITH_XCHARSET=all \
WITH_COLLATION=utf8_general_ci \
WITH_OPENSSL=yes \
BUILD_OPTIMIZED=yes \
install && make clean

How to Install PostgreSQL on FreeBSD using ports

Step 1 : Update ports
Step 2 : cd /usr/ports/databases/postgresql92-server
Step 3 : make && make install && make clean
Step 4 : /usr/local/etc/rc.d/postgresql initdb
Step 5 : Add following line to /usr/local/pgsql/data/pg_hba.conf
             host    all             all             _your_network_          password
Step 6 : Change this value in file /usr/local/pgsql/data/postgresql.conf
             #listen_addresses = 'localhost'    -> listen_addresses = '*'
             #port = 5432                             -> port = 5432
Step 7 : Add Following line to /etc/rc.conf
             postgresql_class="postgres"
             postgresql_enable="YES"
Step 8 : Start you postgres using command
             /usr/local/etc/rc.d/postgresql start

Solution From : http://wiki.openstreetmap.org/wiki/User:S-s-s_wiki/Creating_a_local_OSM_server_under_FreeBSD

How add postgres user

Step 1 : Add Unix/Linux User
Step 2 : Using Superuser command
             #su -l pgsql
Step 3 : Connect to Database Server
             #psql template1
             or
             #psql -d template1 -U pgsql

             Output
             bla bla bla
             template1=#
Step 4 : Add user
             template1=#CREATE USER xman WITH PASSWORD 'mypass';
Step 5 : Add Database
             template1=#CREATE DATABASE test1;
             template1=#GRANT ALL PRIVILEGES ON DATABASE test1 to xman;
             *** If you want to alter user to superuser use the following command
             ALTER USER myuser WITH SUPERUSER;
             template1=#\q
Step 6 : Test Login
             $su -l xman
             $psql -d test1 -U xman
         
             Output
             bla bla bla
             test1=>

Solution from http://www.cyberciti.biz/faq/howto-add-postgresql-user-account/