# File lib/jdbc_adapter/jdbc_mysql.rb, line 8
    def mysql_connection(config)
      config[:port] ||= 3306
      url_options = "zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false&useUnicode=true&characterEncoding="
      url_options << (config[:encoding] || 'utf8')
      if config[:url]
        config[:url] = config[:url]['?'] ? "#{config[:url]}&#{url_options}" : "#{config[:url]}?#{url_options}"
      else
        config[:url] = "jdbc:mysql://#{config[:host]}:#{config[:port]}/#{config[:database]}?#{url_options}"
      end
      config[:driver] = "com.mysql.jdbc.Driver"
      connection = jdbc_connection(config)
      ::JdbcSpec::MySQL.kill_cancel_timer(connection.raw_connection)
      connection
    end