# File is locked - how to unlock

**URL:** <https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883>\
**Category:** 📑 How to\
**Tags:** database\
**Created:** [July 24, 2016, 8:56am UTC](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883 "2016-07-24T08:56:50Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![pedropt](https://help.nextcloud.com/letter_avatar/pedropt/32/6_22734026db12803ebb3e059622ac3534.png) [@pedropt](https://help.nextcloud.com/u/pedropt)\
**Post date:** [April 25, 2017, 7:34am UTC](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883/9 "2017-04-25T07:34:57Z")

</div>

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 .

---

_[View the full topic](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883)._
