Return a connection from a function

I just started yesterday with Node.js and I am really enjoying it.

Here's my code:

function connect(){
    var mysql      = require('mysql');
      var connection = mysql.createConnection({
        host     : '127.0.0.1',
        user     : 'MyUser',
        password : 'MyPass',
      });
      connection.connect();
      return connection;
}
function MyFunc(req,res){
       var conn = connect();
       conn.query('SELECT * from anything', function(err, rows, fields) {
            res.write(JSON.stringify(rows));
        });
}

Well, the return connection fails. Yes, I test already with return connection();, but no success anyway.
Can someone help me with this probably simple thing?