README.connection_strings 4.1 KB

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