admin管理员组文章数量:1244247
I am working on a 'sign up' page and having trouble with sqlite.
I am using express, bcrypt-nodejs, bookself.js for sqlite. getting an error saying database is lock. any workaround for this? appreciated. below is the code for the part.
app.post('/signup', function(req, res){
var username = req.body.username;
var password = req.body.password;
bcrypt.hash(password, null, null, function(err, hash){
new User({'username': username, 'password': hash})
.save()
.then(function(){
console.log('Successfully added a user');
})
.catch(function(err){
throw err;
});
});
res.render('login');
});
I am working on a 'sign up' page and having trouble with sqlite.
I am using express, bcrypt-nodejs, bookself.js for sqlite. getting an error saying database is lock. any workaround for this? appreciated. below is the code for the part.
app.post('/signup', function(req, res){
var username = req.body.username;
var password = req.body.password;
bcrypt.hash(password, null, null, function(err, hash){
new User({'username': username, 'password': hash})
.save()
.then(function(){
console.log('Successfully added a user');
})
.catch(function(err){
throw err;
});
});
res.render('login');
});
Share
Improve this question
edited Nov 3, 2015 at 16:32
jhlosin
asked Nov 3, 2015 at 8:18
jhlosinjhlosin
5752 gold badges7 silver badges17 bronze badges
2 Answers
Reset to default 14The problem was that you have the ".sqlite" file opened by other editors or SQLite Clients while interacting with SQLite programmatically.
Make sure the .sqlite file is not opened/used by any other application before running/testing your code.
Also works, when you kill the running port.
For ubuntu Use:
'sudo kill -9 `sudo lsof -t -i:<POOR_NUMBER>`'
本文标签: sqlitejavascript SQLITEBUSY database is lockedsql insert into quotusersquotStack Overflow
版权声明:本文标题:sqlite - javascript SQLITE_BUSY: database is locked, sql: insert into "users" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740118585a2227553.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论