Skip to content

handshake event not hit? #949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SantoDE opened this issue Dec 1, 2014 · 1 comment
Closed

handshake event not hit? #949

SantoDE opened this issue Dec 1, 2014 · 1 comment
Labels

Comments

@SantoDE
Copy link

SantoDE commented Dec 1, 2014

Hey folks,

I'm currently trying to setup a mysql connection within a grunt task. However, I'm struggling badly and I can't see why.

I'm trying to set it up like this:

var mysql  = require('mysql');  
var connection = mysql.createConnection({
    host     : grunt.config('db.settings.host'),
    user     : grunt.config('db.settings.user'),
    password : grunt.config('db.settings.password'),
    port : '8889',
    debug: true
});

connection.connect(function(err) {
    if (err) {
        grunt.log.write('error connecting: ' + err.stack);
    return;
    }

    grunt.log.write('connected as id ' + connection.threadId);
});

However, it never hits the connect callback. I debugged trough the modules code and figured, that the "handshake" never get's hit. I'm obviously doing something massively wrong, but I can't see the mistake while comparing it to the examples.

Any help? :)

Cheers!

@SantoDE
Copy link
Author

SantoDE commented Dec 1, 2014

Ok, looks like it's a problem while running it within grunt. If i run it separately in node, it works fine. Nvm im that case :)

@SantoDE SantoDE closed this as completed Dec 1, 2014
dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants