Install the database, and the installation entry is assumed to be D:\Program Files\Firebird\Firebird_2_5. After the installation is complete, open the CMD window as an administrator and switch to the D:\Program Files\Firebird\Firebird_2_5\bin directory:
cd /d D:\Program Files\Firebird\Firebird_2_5\bin
Then enter the command to log in to the database:
isql -u sysdba -p masterkey
Create a database:
create database 'D:\DATA\FIREBIRD\DMS.FBD';
Create user:
create user sa password ‘888888’;
Connect to the database:
connect 'D:\DATA\FIREBIRD\DMS.FBD' user sa password ‘888888’;
For ease of use, you can configure the database in the D:\Program Files\Firebird\Firebird_2_5\aliases.conf file, as follows:
Then you can connect to the database through connect DMS user sa password '888888';
First connect to the DMS database through the sysdba account, and then grant administrator role permissions to sa,
Authorize all permissions on the student table to user sa:
Use the sysdba user to connect to the dms database, and then authorize the sa user:
grant all on student to sa;
Common commands:
select * from student; 查询全部数据
select first 2 skip 10 username,age from student; 查询第11及12条记录
Next, if you want to use C# to connect to the Firebird database, you first need to download FirebirdSql.Data.FirebirdClient-6.4.0-net452.7z, download and decompress it, and reference the decompressed FirebirdSql.Data.FirebirdClient.dll in the C# project.
Then use the following method to get the connection string:
Note: Be sure to set Dialect=1, otherwise it will report an error message "The format of the program you are trying to load is incorrect".
For the embedded type, you also need to download Firebird-2.5.8.27089-0_x64_embed.zip (URL Firebird: Firebird 2.5.8 ), and unzip fbembed.dll, firebird.conf, ib_util.dll, icudt30.dll, icuin30 in the directory .dll, icuuc30.dll six files copied to the application directory.
In the program, set ServerType=FbServerType.Embeded