How to solve this below code?

Error: Could not open database
at newSQLError (SQLitePlugin.js:25)
at SQLitePlugin.js:198
at Object.module.exports [as exec] (cordova.js:992)
at (SQLitePlugin.js:205)
at new SQLitePlugin (SQLitePlugin.js:84)
at Object. (SQLitePlugin.js:591)
at Object.openDatabase (SQLitePlugin.js:58)
at main.js:90684
at new t (polyfills.js:3)
at SQLite.openDatabase (main.js:90682)
at s (polyfills.js:3)
at s (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (main.js:37109)
at t.invokeTask (polyfills.js:3)
at e.runTask (polyfills.js:3)
at i (polyfills.js:3)
at HTMLButtonElement.invoke (polyfills.js:3)

when i am running in ionic run browser…

Browser doesn’t use sqlite plugin but it can fall back to websql, you need to initialize the database slightly differently in that case:

if (typeof window.sqlitePlugin !== 'undefined' && !'core') && !'mobileweb')) {
    this.db = window.sqlitePlugin.openDatabase({ name: this.dbname, location: 'default' });
} else {
    this.db = window.openDatabase(this.dbname, '1.0', 'Test DB', -1);

and some additional text because it won’t let me post something too similar since I accidentally put this answer in the wrong thread previously…

Chances are you really want to be using ionic-storage anyway.