sqlite 未打开本地驱动器上的数据库文件
我最近升级了一辆运行蒙特雷的新 M1。我现有的 sqlite 数据库文件存在于外部驱动器上,我可以通过 DBI 使用 Perl 访问它们。但是当我将 .db 文件复制到本地内部驱动器时,sqlite 无法打开它们。
$dbh=DBI->connect('dbi:SQLite:dbname=/Users/trudge/MyDB/kb.db','','') or die $DBI::errstr;
抛出这个错误: DBI connect('dbname=/Users/trudge/MyDB/kb.db','',...) 失败:无法在 /Users/trudge/http/cgi-bin/kb/index.pl 行打开数据库文件74. 无法打开 /Users/trudge/http/cgi-bin/kb/index.pl 第 74 行的数据库文件。
我已经重新编译了 sqlite3 (SQLite 版本 3.38.1 2022-03-12 13:37:29)但仍然没有喜悦。
不确定这是 DBI 问题、sqlite 问题还是 Apple 问题。显然 DBI 支持 sqlite 3.3,这应该不是问题。
许可& ACL:
-rwxrw-rw- 1 trudge staff 102400 Mar 10 12:20 ephemera.db
-rw-rw-rw-@ 1 trudge staff 458752 Mar 5 17:19 kb.db
-rwxrw-rw- 1 trudge staff 90112 Mar 10 12:20 kba.db
-rwxrw-rw- 1 trudge staff 262144 Mar 10 12:20 library.db
-rwxrw-rw- 1 trudge staff 1630208 Mar 7 20:13 tunes3.db
对于为什么这是一个问题以及如何解决它,我将不胜感激。
I've recently upgraded to a new M1 running Monterey. My existing sqlite db files exist on an external drive and I can access them with Perl via DBI. But when I copy the .db files to my local internal drive, sqlite is not able to open them.
$dbh=DBI->connect('dbi:SQLite:dbname=/Users/trudge/MyDB/kb.db','','') or die $DBI::errstr;
throws this error:
DBI connect('dbname=/Users/trudge/MyDB/kb.db','',...) failed: unable to open database file at /Users/trudge/http/cgi-bin/kb/index.pl line 74.
unable to open database file at /Users/trudge/http/cgi-bin/kb/index.pl line 74.
I've recompiled sqlite3 (SQLite version 3.38.1 2022-03-12 13:37:29) but still no joy.
Not sure if this is a DBI problem, or an sqlite problem, or an Apple problem. Apparently the DBI supports sqlite 3.3 which should not be an issue.
Permission & ACL:
-rwxrw-rw- 1 trudge staff 102400 Mar 10 12:20 ephemera.db
-rw-rw-rw-@ 1 trudge staff 458752 Mar 5 17:19 kb.db
-rwxrw-rw- 1 trudge staff 90112 Mar 10 12:20 kba.db
-rwxrw-rw- 1 trudge staff 262144 Mar 10 12:20 library.db
-rwxrw-rw- 1 trudge staff 1630208 Mar 7 20:13 tunes3.db
I would appreciate any advice or suggestions as to why this is an issue and how I might solve it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如此简单的解决方案。我检查了远程站点(托管)上数据库文件的权限。该目录是 755。我的本地系统不是。一旦我在本地进行了更改,我终于可以访问所有 sqlite 数据库文件。
对于这样的新疏忽表示歉意。也许我应该从此退休。
Such a simple solution. I checked permissions on my remote site (hosted) for the DB files. The directory was 755. My local system was not. Once I made the changes locally I finally had access to all the sqlite db files.
Apologies for such a newb oversight. Maybe I should retire from this.