diff --git a/lib/mysql.js b/lib/mysql.js index f72c72c..53b41a8 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -57,6 +57,9 @@ exports.initialize = function initializeDataSource(dataSource, callback) { // Take other options for mysql driver // See https://github.com/strongloop/loopback-connector-mysql/issues/46 for (var p in s) { + if (p === 'database' && s.createDatabase) { + continue; + } if (options[p] === undefined) { options[p] = s[p]; } @@ -149,7 +152,7 @@ MySQL.prototype.query = function (sql, callback) { connection.query(sql, function (err, data) { if (debugEnabled) { if (err) { - console.error('Error: ', err); + console.error('Error: %j', err); } debug('Data: ', data); } @@ -655,7 +658,7 @@ MySQL.prototype.autoupdate = function (models, cb) { function done(err) { if (err) { - console.error(err); + console.error('%j', err); } if (--wait === 0 && cb) { cb();