Recent Comments

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

2011年7月27日 星期三

Ubuntu 11.04 IBUS安裝無蝦米輸入法

下載網址
https://github.com/vicamo/ibus-table-boshiamy/downloads

安裝好後,點選IBUS後執行『重新啟動』後到『偏好設定』裡把嘸蝦米輸入法加入即可

2011年7月3日 星期日

password authentication failed for user "postgres"

postgresql安裝好後用pgadmin連接出現如下的錯誤訊息:

Error connecting to the server:FATAL: password authentication failed for user "postgres"  

錯誤原因是沒有設定postgres的密碼,檢查及設定如下:
[root@Vigor14 ~]# su -l postgres -bash-3.2$ psql psql (8.4.7) Type "help" for help.  postgres=# select * from pg_shadow;  usename  | usesysid | usecreatedb | usesuper | usecatupd | passwd | valunti l | useconfig  ----------+----------+-------------+----------+-----------+--------+-------- --+-----------  postgres |       10 | t           | t        | t         |        |           |  (1 row)  postgres=# alter user postgres with password 'postgres'; ALTER ROLE postgres=#  

安裝ora2pg

安裝ora2pg

  • 安裝 perl-DBD-Pg
    yum install perl-DBD-Pg
  • 安裝ora2pg
    tar -xvf ora2pg-8.4.tar.bz2
    cd ora2pg-8.4
    perl Makefile.PL
    make
    make install
  • 執行 ora2pg -h
    若出現下列的結果請先安裝『perl-DBD-Pg』套件
    [root@DB ora2pg-8.4]# ora2pg
    Can't locate DBD/Pg.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/lib/perl5/site_perl/5.8.8/Ora2Pg.pm line 921.
    BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/Ora2Pg.pm line 921.
    Compilation failed in require at /usr/local/bin/ora2pg line 27.
    BEGIN failed--compilation aborted at /usr/local/bin/ora2pg line 27.
  • 設定ora2pg
    vim /etc/ora2pg/ora2pg.conf
    資料庫連接修改內容如下:
    ORACLE_HOME /opt/oracle/product/10.2.0/db_1
    ORACLE_DSN dbi:Oracle:host=localhsot;sid=hccg
    ORACLE_USER hccg
    ORACLE_PWD xxxxx

安裝 DBD-Oracle

安裝 DBD-Oracle
  • 設定參數
    export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
    export LD_LIBRARY_PATH=/opt/oracle/product/10.2.0/db_1/lib32
    ln -s /opt/oracle/product/10.2.0/db_1/lib /opt/oracle/product/10.2.0/db_1/lib32
    ln -s /opt/oracle/product/10.2.0/db_1/rdbms/lib /opt/oracle/product/10.2.0/db_1/rdbms/lib32
  • 安裝
    tar -xvzf DBD-Oracle-1.28.tar.gz
    cd DBD-Oracle-1.28
    perl Makefile.PL
    make
    make install

安裝postgresql資料庫

安裝postgresql資料庫
  • 安裝資料庫postgresql84
    yum install postgresql84 postgresql84-server postgresql84-libs
  • 第一次執行需要初始化資料庫
    service postgresql initdb
  • 啟動資料庫
    service postgresql start
  • postgresql設定開機時啟動
    chkconfig postgresql on
  • 修改/var/lib/pgsql/data/pg_hba.conf
    host all all 127.0.0.1/32 md5
    host all all 192.168.1.0/24 md5
  • 修改/var/lib/pgsql/data/postgresql.conf
    listen_addresses = '*'
  • 重新載入設定
    su -l postgres
    pg_ctl reload