Thanks Alan! That's got it. :)
On Sep 24, 11:25 pm, Alan Gutierrez <
a...@prettyrobots.com> wrote:
> The node-mysql library works great. I am using it in a project that I
> converted from a Java. The line count of the application went down by
> an order of magnitude. From 2,400~ to 240~. A huge part of it was
> replacing Hibernate, JPA and all the XML and model classes that go
> with it, with a handful of JavaScript functions.
>
> Your problem is that you're calling end after calling connect, but
> connect is asynchronous, so the connection has not been made when you
> call end, so it is a noop. Wait for the connection, then end it.
>
> var Client = require('mysql').Client
> , client = new Client();
>
> client.user = 'scott';
> client.password = 'tiger';
> client.database = 'accounting';
>
> client.connect(function () {
> client.end();
>
> });
>