rss

EPUB for MySQL documentation, Farewell CHM

Category : MySQL

The official logo of the database query MySQL
The official logo of the database query MySQL
Image via Wikipedia

For MySQL has published its docs this time in EPUB format, other docs formats are also available. CHM has been the de facto standard file format for help on windows. The CHM technology is getting a bit behind as more formats are available in the market that makes the document available on many different formats. Microsoft introduced a new successor format with windows Vista i.e AP Help but it doesn’t got the popularity, because of this many have started providing the docs in PDF format.

MySQL has been providing the the CHM file format docs but that has its own problems which require time to handle. With the increasing complexity and size of our documentation (the MySQL 5.1 Manual contains more than 1.6 million words now!), providing CHM has become more and more of a pain. MySQL has stopped shipping CHM with the MySQL Server on Windows months ago.

MySQL has started providing EPUB-format docs. EPUB (see http://en.wikipedia.org/wiki/EPUB) is an open standard format for screen readers, mobile or not, and is fairly easy (and not resource-intensive!) to compile.

Go to http://dev.mysql.com/doc to grab MySQL documentation in EPUB format. To read EPUB on desktop machines, I use a Firefox add-on & calibre-0.7.17, unsurprisingly called epubreader, which loads EPUB documents fast and renders them nicely. That said, please be aware that EPUB can’t do anything about the fact that the MySQL Reference Manual is huge, so downloading it to a mobile device can take a while. The MySQL 5.1 Manual is currently a whopping 15 MB!

Share

PHP: Fuzzy Address Matching Algo (Levenshtein)

Category : MySQL, PHP

Few days back i encountered a weird problem.
I had three tables in my DB viz: students, sites, company. Student table has the address fields and a column named “site_id” to connect it to the sites table. Sites table also has its address fields.

Now the challenge was to update the “site_id” field of the students table based on the matching address in the student and the site table. The address fields in both the tables were divided into following fields

  • address1
  • address2
  • city
  • state
  • country
  • zip

Now i had to think of a solution of how to do it. After googling a while i found a function called “levenshtein()” in PHP. This function calculated the distance between two given strings, bingo i got an idea and implemented the sddress matching algorithm. I have attached the file with this post.
Kindly let me if that was helpful to you.

Download the code from here -> fuzzy-match

Share

ERROR 126 (HY000): Incorrect key file for table

2

Category : MySQL

I had a table with 62 Millions records with total size on disk as 1.2 GB.
What i was doing was joining this table with other table having 80 thousand records.

While running the query the MySQL server showed me an error

ERROR 126 (HY000): Incorrect key file for table

The problem behind thisĀ  was related to the size of the temp directory, there was not enough memory on the drive where the temp directory was located.
SOLUTION
Try to change the location of the MySQL tmp directory to a place where there is lots of space. you can do this by editing the MySQL config file and adding this entry

tmpdir=”/path/to/the/temp/directory”

Share

Amit Yadav is Stephen Fry proof thanks to caching by WP Super Cache