I have strange problem. Under Windows database was created. And now under FreeBSD I am attempting to export data into csv. Fbexport is works under Linuxulator (Linux binary). From isql-fb I can connect to DB and do any action like SELECT, but from fbexport - unable.
root@sms# fbexport -Sc -D /home/sms2/DB2.FDB -H 127.0.0.1 -U 'SYSDBA' -P 'masterkey' -F full.txt -A "WIN1251" -B ::: -Q "SELECT * FROM AGENTS;"
Connecting to: '127.0.0.1' as 'SYSDBA'...ERROR!
*** IBPP::SQLException ***
Context: Database::Connect
Message: isc_attach_database failed
SQL Message : -551
This user does not have privilege to perform this operation on this object.
Engine Code : 335544352
Engine Message :
no permission for read-write access to database /home/sms2/DB2.FDB
What do I wrong?
The fbexport tool connects to the database using a server (in this case listening on localhost). You are trying to access a database in a home directory through a Firebird server instance on localhost. The Firebird server runs under a specific user (eg firebird) and this user does not have read/write access to the database /home/sms2/DB2.FDB.
The reason it works when connecting with isql-fb is that isql by default uses the embedded engine connecting directly to the database without going through the Firebird server instance running on localhost (if you'd connect to localhost:/home/sms2/DB2.FDB with isql you'd get the same or similar error message).
You either need to grant the firebird group read and write access to the database in your home folder, or move it to a location outside of the home directory (+ grant the firebird user or group read/write to the file).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With