You should be able to insert a new password into the database - however as we don’t store plain text passwords in the database you’ll have to hash it first.
Looking at https://github.com/TryGhost/Ghost/blob/master/core/server/lib/security/password.js
You should be able to create a little script like:
// make-password.js
require('/path/to/ghost/core/server/lib/security/password')
.hash(process.argv[2])
.then(console.log);
node make-password.js "<your-new-password>"
You should then be able to insert that value in the the password column of the users table.
Let me know if that helps