Vote 7

How To Export MS Access Database To MySQL Database

August 30th, 2008

Here are few tips (with undocumented features) to help you export huge MS Access database (production database with real data) to MySQL.

Read more (340 words) »

Vote 2

Global Search & Replace Using vi Editor

August 30th, 2008

To perform a global search and replace in vi editor, use the search and replace command in command mode:
Read more (117 words) »

Vote 3

Is Ruby very syntax rich? Do you like it? I don’t.

August 19th, 2008

I tried delving into Ruby couple of times in the past. Every time I had this weird feeling of what am I doing here when I am already very well conversant with a simpler language - Java, which gives me everything I need. Ruby just felt very syntax rich, may ways and interesting tricks to do stuff and so on.While these may be appealing to a script-kiddie, nice syntactical sugars do not help much in the long run or help you create robust code (unless you love flying whales and a service which fails every other day).

I am not afraid of developing CRUD interfaces nor do I find it time consuming. What value can I get from RoR? Every time I delve into Ruby & RoR, I come back feeling unsatisfied. What am I missing here?

Read more (315 words) »

Vote 1

Db4o Note: Db4o.configure() != Db4o.newConfiguration()

August 19th, 2008

In earlier versions of Db4o we used Db4o.configure() to configure all Db4o database globally (across all ObjectContainer). However in 7.2 (and above) versions of Db4o Db4o.configure() has been deprecated and it is suggested to use Db4o.newConfiguration() instead. Unfortuanately they do not clearly mention anywhere that these two functions are not equivalent. I assumed they are equivalent like Db4o.set()is equivalent Db4o.store() or Db4o.get() is equivalent to Db4o.queryByExample().

Read more (201 words) »

Vote 2

Biggest Db4o Gotcha!

August 18th, 2008

Db4o is an excellent open source object database for Java & .NET platform by Carl Rosenberger's team. I highly recommend it for rapid prototyping and RAD. It transparently handles object storage and retrieval. Today I will talk about the single biggest gotcha in Db4o which is bound to stumble any newcomer as well as pros who haven't been using it in a while.

In Db4o you can create an complex objects with other objects as its member and Db4o will save them all like a champ with a single set() (now store()) method. So intuitively you try to use the same concept for updating the database. This is where you will stumble. Db4o by default doesn't recurse when updating an object.The stranger aspect is that when you save it to the database with a store or set and then retrieve it again it will appear to work fine. However after you close and re-open the database your data will be lost! This is the single most baffling feature I found in Db4o.

Read more (318 words) »

Vote 3

One MySQL Configuration Tip That Can Dramatically Improve MySQL Performance

August 13th, 2008

I mean every word of it. I found this simple configuration tip after days of continuously looking at MySQL logs (mytop), top, slow log queries, debugging the hell out of applications, reading tons of MySQL optimization tips (and pulling my remaining hairs in frustration) on the web. Even MySQL optimization tips from MySQL doesn't mention it. And yet this single tip solved all my MySQL headaches and performance problems. Here are some of the problems I faced:

My powerful dedicated server was frequently consuming 100% of the CPU even with moderate load.
Even with tons of optimization and indexes, I found my server idle CPU going to 0%. The key resource consumer was MySQL. The worst part was that MySQL refused to serve new request as all threads were exhausted waiting (for some miracle to happen?).

Does any of that sound familiar? Then read on for the gory technical explanations and the tip.

BTW: My initial reaction to such problems was the standard one. I looked at MySQL master-master replication (this is better than the master-slave replication which WordPress.com does for its sites) to take care of the increased load. Fortunately this single configuration change made my server take at least 10 times more load than before.

Read more (590 words) »

Vote 1

How To Change MySQL Password

April 20th, 2008

Let's look at all the ways to change MySQL password, for root and other users:

Read more (78 words) »

Vote 0

How To Use AWK To Simplify Scripting: Multi-Database Backup Example

April 20th, 2008

AWK is an extremely versatile and powerful language for processing files and text data. Often you can use awk to perform complex tasks on Unix / Linux / Mac OS command line which would otherwise take a full-fledged programming effort. AWK is great for log processing, creating custom scripts which will then be executed and more. For example I wanted to create a backup of all of my MySQL databases, each to a separate file after compressing them with gzip (maximum compression). I already created a list of databases on my MySQL server is a file named databases (how original!). Here is the awk script which processes the file and creates another file (named database_backup) which contains commands to backup all the databases as specified above.
Read more (172 words) »

Vote 0

MySQL Tip: How To Check, Repair & Optimize All Tables in All Databases

April 20th, 2008

Here is a simple command to auto repair, check and optimize all the tables in all databases running on a MySQL server:

Read more (149 words) »

Vote 0

MySQL High End Features Should be Closed Source & for Paid Customers Only

April 18th, 2008

I am serious. While MySQL is a great open source database, I have full respect to Sun's plan to provide high-end features for paying customers only. After all they are in the business of making money and not philanthropy, last I checked.

Read more (135 words) »