dongyuchen9276 2018-11-11 14:35
浏览 178

使用PHP / Windows / MySQL连接到GDB数据库文件

I have a database file: laboratoire.GDB.

My goal is to connect to this database and get informations.

I have installed WAMP (Windows, Apache web server, Mysql server and PHP) and enabled the extension of firebird and interbase.

When i try to connect to database, I get the following error message:

(ibase_connect(): Unable to complete network request to host "localhost". Failed to establish a connection. in C:\wamp\www\teste.php on line ...)

Here is my code:

$host = "localhost:C:\wamp\www\laboratoire.GDB";
$username="SYSDBA";
$password="masterkey";
$dbh = ibase_connect($host, $username, $password);
  • 写回答

1条回答 默认 最新

  • dongyuxin5353 2018-11-12 09:35
    关注

    You said you installed MySQL Server. You also said you try to read database file with GDB extension. But that is not MySQL database and your MySQL/MariaDB server can not read it.

    GDB extension is typical for Firebird/Interbase/Yaffil/Fyracle/RedDataBase family of servers. So you have to install one of those to read the file. Assuming it is that format and not some another (for example Windows XP uses GDB extension for their own purposes, maybe other software too - http://www.firebirdfaq.org/faq353/ ).

    First check is to use IB FirstAid to try and open your DB file. If it will open - you would have to check database format (so called ODS) to see which server you need to install.

    Run FirstAid, open the database, press "Direct Diagnostic" button and on "Direct Fix" tab find text like

    12:48:17 INFO: Running procedure: Header page check
    12:48:17 INFO: ODS Major = 11 (32779)
    12:48:17 INFO: ODS Minor = 1
    

    Firebird marker is 32779 = 11+32768, Interbase marker would be zero difference.

    You can also check ODS in IBExpert Trial under Tools / Database Inside menu

    If the file would be opened, then you need to determine if your file belong to Firebird or Interbase family, other flavors are very rare. However if despite the name this filename has nothing to do with FB/IB family - then you would have to determine what real format is.

    Assuming you learned ODS and you checked that is Firebird's ODS not Interbase's ODS the next junction would be:

    • ODS 12 => Firebird 3.x
    • ODS 11.x => Firebird 2.5.x
    • ODS 10.x => Firebird 1.x or 2.x.x of exactly the same bitness and endianess.

    See http://www.firebirdfaq.org/faq125/

    Whether FirstAID would show your file is of Interbase not Firebird family - you would have to refer to Interbase documentation to select and install proper server version.

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘