module.exports = function(config) {
  var mysql = require('mysql');
  var fs = require('fs');
  config.multipleStatements = true;
  var pool = mysql.createPool(config);
  console.log(__dirname+'/schema.sql')
  pool.query(fs.readFileSync(__dirname+'/schema.sql').toString());
  if (config.max_allowed_packet)
    pool.query("set global max_allowed_packet=?", [config.max_allowed_packet]);
  return pool;
};
