Browse files

Created a mysql script.

 * Implementing mysql query as a packet parsing example.
  • Loading branch information...
1 parent e281974 commit e3b3c96ea50237373404e00d6d1bdd3ddb3f055a Alan Gutierrez committed Sep 13, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 mysql.js
View
15 mysql.js
@@ -0,0 +1,15 @@
+var net = require("net"),
+ packet = require("./lib/packet");
+
+var mysql = net.createConnection(3306);
+
+var parser = packet.parser();
+parser.packet("greeting", "n8", function (version) {
+ console.log(version);
+});
+
+mysql.on("connect", function () {
+ console.log("Connect.");
+ mysql.end();
+});
+console.log("Okay.");

0 comments on commit e3b3c96

Please sign in to comment.