Configure Ghost Blog using MySQL

By default Ghost uses sqlite3 database. If you want to use MySQL, this can be done by changing configuration config.js. Please follow changes suggested in below post to use MySQL in Ghost blog.

Ghost blog configuration is as below:

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

This needs to be changed to following

        database: {
            client: 'mysql',
            connection: {
                host: 'localhost',
                user: 'username',
                password: 'password',
                database: 'ghost',
                charset: 'utf8'
            debug: true

You can make this change in production section of configuration and keep development section as is. You need to ensure that you start Ghost server in production by following command

npm start --production  

Leave a Reply

Your email address will not be published. Required fields are marked *