File is locked - how to unlock

For those that do not know how to connect or even the owncloud database name in mysql (mariadb) , follow these instructions :

0 - put your nextcloud under maintenance mode on config.php , so no one access it while you are doing changes .

1st - open your config.php in your nextcloud server folder under “config” folder .

2nd - there should be a field the like this : " ‘dbname’ => " , in this field there is your database name .

3rd - open a terminal window and execute under a root account :

  • mysql -u root -p
    "enter your password"

then connect to nextcloud database with the following command :

  • connect database
    database = your config.php databasename field

after this point all you have to do is to issue the sql command to delete all data inside the oc_file_locks table

-DELETE FROM oc_file_locks WHERE 1;

then after this point all you have to do is :
\q

to close sql prompt and you are done .

Remove the maintenance mode from config.php and start uploading your files over web interface or dav .

11 Likes