# Change ionic database path 5

**URL:** <https://forum.ionicframework.com/t/change-ionic-database-path-5/208966>\
**Category:** Ionic Framework\
**Created:** [May 2, 2021, 9:11pm UTC](https://forum.ionicframework.com/t/change-ionic-database-path-5/208966 "2021-05-02T21:11:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbarett](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@dbarett](https://forum.ionicframework.com/u/dbarett)\
**Post date:** [May 2, 2021, 9:11pm UTC](https://forum.ionicframework.com/t/change-ionic-database-path-5/208966/1 "2021-05-02T21:11:25Z")

</div>

I am working with ionic 5 and sqlite and I need to know how I can change the default path in which the sqlite database is created on my device, since I currently do not know what the default path is and so far I have not found anything that can help me

```auto

this.platform.ready().then(()=>{

  if (!this.isOpen) {

  this.sqlite = new SQLite();    

  this.sqlite.create({ name: "data.db", location: "default",createFromLocation: 1 }).then((db: SQLiteObject) => {

  this.db = db;

      this.isOpen = true;

    }).catch((error) => {

      this._PresentacionService.presentAlert(error);

    })

  }

});

```

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [May 2, 2021, 10:57pm UTC](https://forum.ionicframework.com/t/change-ionic-database-path-5/208966/2 "2021-05-02T22:57:04Z")

</div>

> [@dbarett](#):
>
> `this.sqlite = new SQLite(); `

Unless you have really good reasons for avoiding doing so, I would recommend always using Capacitor or Ionic-Native to interface with plugins. As you can see in [the documentation](https://ionicframework.com/docs/native/sqlite), you don’t instantiate `SQLite` objects directly like you are: instead you inject an `SQLite` and call a `create` method on it.

> [@dbarett](#):
>
> I need to know how I can change the default path in which the sqlite database is created on my device

The rest of this post assumes you’re using the underlying plugin referred to above. If not, consult the documentation for whatever plugin you _are_ using.

This is platform-specific, and extensively documented [here](https://github.com/storesafe/cordova-sqlite-storage). The bottom line is that on Android, the database goes where it goes. On iOS, you have some options, but with the `iosDatabaseLocation` option. The `location` option you are using is effectively pointless.
