mysql crashes…

So, what do you do when you get this from your logs?

I/O error reading the header from the binary log

Obviously the binary logs are broken, or at least the last one is. They are usually located in /var/logs/mysql/ and you should not start copying over some old logs with the new name because that would just not make it right, so the solution is,

  1. read your logs and see which *.bin file is corrupted
  2. delete it
  3. open /var/log/mysql/mysql-bin.index and delete the line with the bin file on it.
  4. Restart mysql

et voila 馃檪

Windows based hosting vs Linux based hosting

Lately, Microsoft entered the hosting business with full throttle. The number of Windows servers available on the web for hosting purposes, VPS’s on Microsoft Windows 2003 or DDS’s on MSVS grows quite exponentially.

At this point the end user, the customer does not care much what platform he is hosted on (i.e. Linux or Windows) if he has a simple website, maybe a forum, a blog or something like that because technologies are intertwined: you can get an apache webserver both on windows and linux, and you can get ASP support on Linux. Maybe if he needs some VB applications to run he will definitely need windows based hosting, but that’s about it. He gets FTP to upload files, a control panel (i.e. SWSoft’s Plesk) to manage domains, mail addresses, databases, name servers etc. The main problem here is scalability. Thinking in the future, you need to decide if you are going to expand, and in which direction because you can easily switch from Linux to Windows, but the reverse is not that simple. I would suggest Linux of course, being much more secure, robust and efficient.

Today I had to delete 1 folder on a windows VPS. How much do you think that took? whatever you said, the answer is no! Let’s see:

  • remote desktop to the VPS – 15 seconds
  • locating the folder in question – another 10 – 15 seconds.
  • trying the delete button, checking permissions 1 minute
  • googling for something as trivial as “how to delete a directory with a space in its name” and finding the right solution: 15 minutes. (this is an extreme drawback… Windows problems, are often not well documented)

Add to that stopping the VPS from virtuozzo (vzctl stop VEID), mounting it on the VPS Node (vzctl mount VEID) and going to the mount point ( c:\vz\private\VEID\root\Inetpub\FtpUpload ) and then unmounting (vzctl umount VEID) and restarting the VPS (vzctl start VEID) nand you’ve got yourself a good 25 minutes spent on removing 1 folder:

C:\Inetpub\FtpUpload\ \每ta18594-每\每-;; &20 @tagged .by; quit %f;;…-每\每每-每每\每每–每\每-;% scanned by %d.-每\每每-每

My advice? stick to Linux. Why? because Linux is well documented, it has a great community behind, mature, and many many more qualities can go here.