I can't seem to understand the documentation in http://strapi.io/documentation/configuration#databases
How to connect to MySqlDB? Where in databases.json do i set all my db settings like user: root, pwd: secret123, host: 192.12.2.123, etc.?
Solution for 2020 (Strapi 3.1.3)
Add client
yarn add sails-mysql
Change config
<project>/config/database.js
(for development) or <project>/config/env/production/database.js
(for production)
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: "mysql",
host: env('DATABASE_HOST', 'localhost'),
port: env('DATABASE_PORT', 3306),
database: env('DATABASE_NAME', 'default'),
username: env('DATABASE_USERNAME', 'root'),
password: env('DATABASE_PASSWORD', ''),
},
options: {
useNullAsDefault: true,
},
},
},
});
yarn build
to rebuild your CMS.