FirebirdSQL/1/4
出自VFP Wiki
(修訂版本間差異)
小 |
小 (revert) |
||
(8個中途的修訂版本沒有顯示) | |||
第1行: | 第1行: | ||
- | + | === 使用iSQL測試--在Linux上示範 === | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | == 第一步 – 存取資料庫 == | ||
+ | $cd /opt/firebird/bin | ||
- | + | $isql -user sysdba -password <password*> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | SQL>connect /opt/firebird/examples/employee.gdb; | |
- | + | ||
- | + | SQL>select * from sales; | |
- | + | ||
- | + | SQL>select rdb$relation_name from rdb$relations; | |
- | + | ||
- | + | SQL>help; | |
- | + | ||
+ | SQL>quit; | ||
+ | |||
+ | == 第二步 - 建立資料庫路徑及權限 == | ||
+ | :1) 假如firebird目錄不存在,請用root身分建立: | ||
+ | ::$su - root | ||
+ | ::$mkdir -p /var/firebird | ||
+ | ::$chown firebird:firebird /var/firebird | ||
+ | :2) 建立firebird權限資料檔 | ||
+ | ::run the following script: | ||
+ | ::$cd /opt/firebird/bin | ||
+ | ::$./createDBAlias.sh test.fdb /var/firebird/test.fdb | ||
+ | |||
+ | :3) | ||
+ | ::$vi /opt/firebird/aliases.conf and add the line at the end of the file: | ||
+ | ::test.fdb /var/firebird/test.fdb | ||
+ | :4) 建立資料庫: | ||
+ | ::$/opt/firebird/isql -u sysdba -p <password*> | ||
+ | ::SQL>create database 'localhost:test.fdb'; | ||
+ | ::SQL>quit; | ||
+ | :5) 在設定檔/opt/firebird/firebird.conf 有各參數DatabaseAccess,可以讓我們設定別名. | ||
+ | ::$/opt/firebird/isql -u sysdba -p <password*> | ||
+ | ::SQL>create database '/var/firebird/test.fdb'; | ||
+ | ::SQL>quit; | ||
+ | |||
+ | :$/opt/firebird/isql -u sysdba -p <password*> | ||
+ | ::SQL>connect '/var/firebird/test.fdb'; | ||
+ | ::SQL>quit; | ||
+ | |||
+ | |||
+ | 注:密碼存於密碼檔 /opt/firebird/SYSDBA.password |
在2008年8月27日 (三) 15:58的最新修訂版本
使用iSQL測試--在Linux上示範
第一步 – 存取資料庫
$cd /opt/firebird/bin
$isql -user sysdba -password <password*>
SQL>connect /opt/firebird/examples/employee.gdb;
SQL>select * from sales;
SQL>select rdb$relation_name from rdb$relations;
SQL>help;
SQL>quit;
第二步 - 建立資料庫路徑及權限
- 1) 假如firebird目錄不存在,請用root身分建立:
- $su - root
- $mkdir -p /var/firebird
- $chown firebird:firebird /var/firebird
- 2) 建立firebird權限資料檔
- run the following script:
- $cd /opt/firebird/bin
- $./createDBAlias.sh test.fdb /var/firebird/test.fdb
- 3)
- $vi /opt/firebird/aliases.conf and add the line at the end of the file:
- test.fdb /var/firebird/test.fdb
- 4) 建立資料庫:
- $/opt/firebird/isql -u sysdba -p <password*>
- SQL>create database 'localhost:test.fdb';
- SQL>quit;
- 5) 在設定檔/opt/firebird/firebird.conf 有各參數DatabaseAccess,可以讓我們設定別名.
- $/opt/firebird/isql -u sysdba -p <password*>
- SQL>create database '/var/firebird/test.fdb';
- SQL>quit;
- $/opt/firebird/isql -u sysdba -p <password*>
- SQL>connect '/var/firebird/test.fdb';
- SQL>quit;
注:密碼存於密碼檔 /opt/firebird/SYSDBA.password