sqlite3 数据库被锁定
我在Ubuntu10上。 创建新的数据库文件
touch development.db
使用“想要我的迁移
rake db:migrate
但被锁定”错误
SQLite3::BusyException: database is locked
如何锁定?!
更新可以通过samba锁定。这是共享文件夹
I am on Ubuntu10.
Create new db file with
touch development.db
Want my migrations
rake db:migrate
but get locked error
SQLite3::BusyException: database is locked
How it can be locked?!
update it can be locked by samba. it's shared folder
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我自己也遇到过这个问题。我发现避免对这样的文件进行锁定的唯一方法是将
nobrl
选项添加到您的挂载中。/etc/fstab
中的条目可能如下所示:这大致遵循位于以下位置的 ubuntu wiki 页面:https://wiki.ubuntu.com/MountWindowsSharesPermanently
I have run into this problem myself. I have found that the only way to avoid the lock being placed on a file like this is to add the
nobrl
option to your mount. The entry in your/etc/fstab
might look something like this:This is loosely following the ubuntu wiki page found at: https://wiki.ubuntu.com/MountWindowsSharesPermanently
您应该尝试
rake db:create
而不是touch
。这总是对我有用。也许迁移本身有问题?You should try
rake db:create
instead oftouch
. This always works for me. Maybe there's a problem with the migrations itself?我认为它是被samba锁定的。
我将development.db放在其他非共享文件夹中,一切都按预期进行
i think it was locked by samba.
i put development.db in other non-shared folder and everything works as expected