go - 如果路径包含哈希符号,firebirdsql 无法连接到数据库
问题描述
我正在尝试在 Go (v1.14) 中使用firebirdsql连接到 Firebird 数据库。
db_path := "D:\\DBs\\test.fdb"
conn, err := sql.Open("firebirdsql", ("sysdba:master@127.0.0.1:3050/" + db_path) )
err = conn.Ping()
if err != nil {
fmt.Println("db.Ping failed:", err)
}
上面的代码工作得很好,但是一旦我在路径中引入哈希符号 (#)(例如:) db_path := "D:\\#DBs\\test.fdb"
,我就无法连接,firebirdsql抱怨路径无效(它读取到哈希符号的路径):
db.Ping failed: I/O error during "CreateFile (open)" operation for file "D:\"
Error while trying to open file
The system cannot find the path specified.
它是firebirdsql中的错误还是我在这里做错了什么?
解决方案
推荐阅读
- python - 销毁 Tkinter 标签并关闭 VLC
- bash - 在我的 VSCode 终端中出现此错误:“bash: export: `=': not a valid identifier”
- linux - bash 在另一个完成后执行命令
- json - AWS 开发工具包 GO JSON 解组嵌套响应
- swiftui - 我们如何在 SwiftUI 中为 Angle(degrees: 0) 在 rotationEffect 上绘制实时阴影?
- c++ - 如果我使用 lambda 编写线程,Eclipse c++ 会给我无效的参数
- excel - 将时间与单元格中的给定时间进行比较
- javascript - React 使用 fetch 从 api 获取图像
- amazon-web-services - 如何解决 AWS Lamba 函数部署问题?
- debugging - 在 linux 中使用 gdb 调试器时,如何查看 $0x27 和 %ecx 的内容?