Archive for the 'MySQL' Category

Apache2 MySQL Native Authentication

Hooray! The MySQL DBD driver is finally (probably for some time now) included in the debian distribution of Apache2. :-)

I’ve been waiting for this for years, believe it or not. I’m quite pleased because I mainly use MySQL as a database and digest authentication for HTTP Auth, and now I can use them both together.

The original problem was caused by licensing, but the MySQL folks figured it was worthwhile to make an exception for Apache. Good choice.

Dbslayer on debian

DBSlayer
What is dbslayer? Its a specialized web server that receives urlencoded JSON formatted SQL queries, parses and executes them, and returns a JSON encoded result set over HTTP. Cool huh? I really wish it returned XML instead, and it looks like that might be a possibility, but I’ll have to do some digging and tinkering.

I’m compiling dbslayer on debian:

cd /usr/src
svn co http://www.dbslayer.org/svn/dbslayer/trunk/ ./dbslayer
apt-get install libapr1-dev libaprutil1-dev libmysqlclient15-dev
./configure
make

The binary is located in server/dbslayer.

Configuring the dbslayer.

Yes, it appears that in more recent versions of dbslayer, it is possible to specify a “FORMAT” argument, however it isn’t documented well. Furthermore, its appears to be rather inefficient - the result set is first parsed into json and then serialized into xml, instead of just going straight to xml.

When reading about dbslayer, I found out about mod_ndb. I would really like to combine these two projects!

What I like about DB Slayer
* Standalone http server
* Acts as a mysql proxy
* Can perform load balancing

What I like about mod_ndb
* RESTful interface - all queries are defined as URLs
* Results can be directly output as XML

Another idea is to use Nexista to receive requests and respond with XML or JSON. The idea comes with some side benefits like intelligent caching, security, and a variety of web servers to choose from. But the requirement of PHP and all the extensions is pretty significant.

UPDATE: The Cherokee web server has integrated dbslayer as a mysql loadbalancer. Very interesting. Unfortunately, no XML output. :-(

phpmyadmin error #2013




#2013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 111

This was caused by the remote server I was trying to connect to being bound to the local loopback address. I commented out the bind-address line, restarted, and it worked OK.

Migrating a Primary MySQL Server

I’ve just migrated a primary MySQL server - and everything went smooth. I’ve setup numerous replicated servers, and this was just about as easy, though maybe higher stress! :-)

I’m relocated the primary server to take advantage of the increased bandwidth on a new network I’m managing.