README.connection_strings 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ------------------
  2. Connection strings
  3. ------------------
  4. Connection string is a local or remote path to the database being attached.
  5. The legacy syntax (supported by all Firebird versions) is the following:
  6. For TCP (aka INET) protocol:
  7. <host> [ / <port>] : <file path to database or alias>
  8. For local connections as simple as:
  9. <file path to database or alias>
  10. If host name is omitted, local connection is implied. Depending on settings,
  11. platform and Firebird version, it could be performed via either the embedded
  12. engine or XNET (shared memory) protocol or TCP localhost loopback.
  13. Examples:
  14. Connect via TCP using database name:
  15. 192.168.0.11:/db/mydb.fdb
  16. 192.168.0.11:C:\db\mydb.fdb
  17. myserver:C:\db\mydb.fdb
  18. localhost:/db/mydb.fdb
  19. Connect via TCP using database alias:
  20. 192.168.0.11:mydb
  21. myserver:mydb
  22. localhost:mydb
  23. Connect via TCP using non-default port 3051:
  24. 192.168.0.11/3051:C:\db\mydb.fdb
  25. 192.168.0.11/3051:mydb
  26. myserver/3051:/db/mydb.fdb
  27. localhost/3051:/db/mydb.fdb
  28. myserver/3051:mydb
  29. localhost/3051:mydb
  30. Connect via TCP using non-default service name:
  31. 192.168.0.11/fb_db:C:\db\mydb.fdb
  32. 192.168.0.11/fb_db:mydb
  33. localhost/fb_db:/db/mydb.fdb
  34. myserver/fb_db:/db/mydb.fdb
  35. myserver/fb_db:mydb
  36. localhost/fb_db:mydb
  37. Local connection:
  38. /db/mydb.fdb
  39. C:\db\mydb.fdb
  40. mydb
  41. Additionally, Firebird 3.0 introduces generalized URL-like syntax for
  42. connection strings:
  43. [ <protocol> : // [ <host> [ : <port> ] ] ] / <file path to database or alias>
  44. Where protocol is one of: INET (means TCP) or XNET (means shared memory).
  45. Examples:
  46. Connect via TCP using database name:
  47. inet://192.168.0.11//db/mydb.fdb
  48. inet://192.168.0.11/C:\db\mydb.fdb
  49. inet://myserver/C:\db\mydb.fdb
  50. inet://localhost//db/mydb.fdb
  51. Connect via TCP using database alias:
  52. inet://192.168.0.11/mydb
  53. inet://myserver/mydb
  54. inet://localhost/mydb
  55. Connect via TCP using non-default port 3051:
  56. inet://192.168.0.11:3051/C:\db\mydb.fdb
  57. inet://192.168.0.11:3051/mydb
  58. inet://myserver:3051//db/mydb.fdb
  59. inet://localhost:3051//db/mydb.fdb
  60. inet://myserver:3051/mydb
  61. inet://localhost:3051/mydb
  62. Connect via TCP using non-default service name:
  63. inet://192.168.0.11:fb_db/C:\db\mydb.fdb
  64. inet://192.168.0.11:fb_db/mydb
  65. inet://localhost:fb_db//db/mydb.fdb
  66. inet://myserver:fb_db//db/mydb.fdb
  67. inet://myserver:fb_db/mydb
  68. inet://localhost:fb_db/mydb
  69. The "inet" protocol can be replaced by "inet4" or "inet6" to restrict client
  70. to IPv4 or IPv6 addresses corresponding to supplied name ("inet" protocol
  71. tries all addresses in the order determined by OS):
  72. inet4://myserver/mydb
  73. inet6://myserver/mydb
  74. Loopback connection via TCP:
  75. inet:///db/mydb.fdb
  76. inet://C:\db\mydb.fdb
  77. inet://mydb
  78. Local connection via shared memory:
  79. xnet://C:\db\mydb.fdb
  80. xnet://mydb
  81. Local (embedded by default) connection:
  82. /db/mydb.fdb
  83. C:\db\mydb.fdb
  84. mydb
  85. If protocol and host name are omitted, local connection is implied. Depending on settings,
  86. it could be performed via either the embedded engine or XNET (shared memory) protocol
  87. or TCP localhost loopback.
  88. On the server side, default provider configuration is:
  89. Providers = Remote, Engine13, Loopback
  90. It means that if the remote provider fails to match the connection string (because of missing
  91. protocol / host parts), then the embedded engine handles the hostless connection. If you need
  92. to connect locally using a specific transport protocol, please specify:
  93. inet://<file path to database or alias>
  94. or
  95. xnet://<file path to database or alias>
  96. Note: XNET (shared memory) protocol is available on Windows only.