Hi Simon,

Thank you for your clear instruction. But still I have the same issue.


Here is my test procedures:

#cd /home
#sqlite3 ex1
SQLite version 3.6.23.1
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>create table tbl1(one varchar(10),two smallint);
sqlite3_exec: PH3: rc=101sqlite3_exec: PH7:rc=101sqlite3_exec: 
PH8:rc=0sqlite3_exec: PH9sqlite3_exec: PH10:rc=0sqliteErrorFromPosixError: 
SQLITE_BUSY: sqliteIOErr=3850
Error: database is locked
sqlite> .exit
/home # ls -l
total 4
drwxr-xr-x    2 default  default          0 Feb 19 11:08 default
-rw-r--r--    1 root     root             0 Feb 19 13:26 ex1
/home # rm ex1
/home # sqlite3 ex1
SQLite version 3.6.23.1
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table tbl1(one varchar(10), two smallint);
sqlite3_exec: PH3: rc=101sqlite3_exec: PH7:rc=101sqlite3_exec: 
PH8:rc=0sqlite3_exec: PH9sqlite3_exec: PH10:rc=0sqliteErrorFromPosixError: 
SQLITE_BUSY: sqliteIOErr=3850
Error: database is locked
sqlite> .exit
/home # ls
default  ex1
/home # ls -l ex1
-rw-r--r--    1 root     root             0 Feb 19 13:27 ex1
/home # rm ex1 
/home # touch aaa
/home # ls
aaa      default  ex1
/home # echo "this is test file" > aaa
/home # cat aaa
this is test file

Regards,
David J. Choi


-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
Sent: Tuesday, February 19, 2013 9:14 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] database is locked with create


On 19 Feb 2013, at 5:01pm, "Choi, David" <david.c...@micrel.com> wrote:

> I am new to sqlite. I build sqlite with buildroot without any issue. After 
> loading sqlite on my embedded board, I always get one error message:"database 
> is locked".
> 
> Here is my operation on  my board:
> 
> #sqlite3 ex1
> SQLite version 3.6.23.1
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> create table tbl1(one varchar(10), two smallint);
> Error: database is locked
> sqlite >
> 
> Any suggestion will be highly appreciated.

Quit the shell program.
Locate the database file called 'ex1' and make sure it is in the folder you 
expect it to be in.
If the database file still exists, delete it.
Try again, letting the shell program create a new database.

If this also doesn't work,

Check the privileges in the folder where the database file is created.
Do you have write privileges inside that folder ?
Try using copy command or a simple text editor to make a file in that folder.
Does it work or do you get a similar error to 'file is locked' ?

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to