简体   繁体   中英

Delphi XE2 and Firebird Embedded 2.5 on OSX

I have begun to port my Firemonkey Application into OSX. I used DBExpress driver DevArt. I read this post in order to convert Firebird from Server to Embedded.

But when my application starts, it raises an exception:

Cannot attach to password database

The database is copied from my Windows installation and not created on OS X. I don't think this the problem, but it lies in the conversion from Server to Embedded because the documentation is for the old Firebird version.

Have you got any ideas to solve my problem?

First backup db on win os and restore it on osx. Different physical storage format.

Also, even on embeded version, on mac osx, Firebird use security2.fdb (with write permissions) in case you specify username / password. Without user / pass it should work without security2 database.

Cannot attach to password database means that firebird can not find the users database. It's a file named security.fdb or security2.fdb on Firebird 2.0 and above. This file should be in firebird folder as stated in the IBPhoenix's article you linked.

use this

  1. STEP 1 (make a copy of security.fdb):

/opt/firebird/bin/gbak -user SYSDBA -password masterkey /opt/firebird/security.fdb /opt/firebird/security.fbk

if you get following error you have to chown security.fdb to firebird user!

gbak: ERROR:I/O error for file "/opt/firebird/security.fdb" gbak: ERROR: Error while trying to open file gbak: ERROR: Permission denied gbak:Exiting before completion due to errors

  • STEP 2 (restore the database):

/opt/firebird/bin/gbak -rep -user SYSDBA -password masterkey /opt/firebird/security.fbk /opt/firebird/security.fdb

  • STEP 3 (database conversion):

/opt/firebird/bin/isql -user SYSDBA -password masterkey -i /opt/firebird/upgrade/security_database.sql /opt/firebird/security.fdb

  • STEP 4 (stop the firebird):

service firebird stop:

  • STEP 5 (overwrite the old security fdb):

cp security.fdb security2.fdb

Autor: Marcin Rybak

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM