How to Configure Ghost with MySQL

By default Ghost uses sqlite3. This tutorial will show you how to setup a MySQL database for Ghost

By default Ghost uses sqlite3 database. Still, if you would like to have your Ghost Blog installed and configured with MySQL database you can reconfigure the default settings in the config.js file following this guide.


Login your server via SSH and navigate to your Ghost root directory. If you have followed our Ghost and Node installation guide your Ghost directory should be under /var/www/ghost.


Open config.js file using your favorite text editor and locate the Production environment settings which should be somewhere around line 43.


You will need to replace the following lines:


        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost2.db')


with your MySQL configuration using the following syntax:


       database: {
            client: 'mysql',
            connection: {
                host: 'localhost',
                user: 'database-user',
                password: 'database-user-password',
                database: 'database-name',
                charset: 'utf8'


Remember to replace the database host, database-user, database-user-password and database-name with your actual settings. You can now continue with the Ghost installation process