firewing1's blog

Troubleshooting the MySQL Server 5.1 service on Windows Vista

Although some users have reported success, most installations I've tried of MySQL 5.1 on Vista have failed, even on fresh Vista installs. The first problem appears at the end of the service instance configuration. All appears to be well, however the server refuses to start with Could not start MySQL service or Could not start the service MySQL. Error: 0.

The trick is to start MySQL from the console so that you are able to see the error message (you can access the command console by typing cmd into the Run dialog):

cd "C:\Program Files\MySQL\MySQL Server 5.1\bin"
mysqld -nt --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" --standalone --console

In my case, MySQL always returned the same error message:

Plugin 'InnoDB' init function returned error.
Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Unknown/unsupported table type: INNODB
Aborting
Forcing shutdown of 1 plugins

This message is a symptom of the log file size problem (just google InnoDB: Error: log file .\ib_logfile0 is of different size for more information). All you need to do is to clear the following files from the folder C:\ProgramData\MySQL\MySQL Server 5.1\data:

ib_logfile0
ib_logfile1
ibdata1
$YOUR_HOSTNAME$.err

Restart the MySQL server and all should be well. Note that the C:\ProgramData\ folder is hidden, so unless you have enabled hidden folders from the Folder Options dialog, you will need to copy/paste that folder path directly into the address bar in order to access the folder.

Rating: 

Vista + Loose SATA cable = Bad news

So... Here's what I have been doing during the past 5 hours:

I was noticing some odd behavior from my PC, which runs Fedora Linux as its primary OS but it also has Windows Vista installed for gaming. The machine would boot without any indication of trouble, but once it had been up & running for about 5 minutes, the system would hang and the hard disk activity light on the case would stay permanently on. A soft reboot wouldn't fix the problem either - a complete shutdown was required. At first I thought it was an OS problem, so I rebooted into Vista but found it was affected too. I immediately thought, "hardware". I tried leaving the computer alone for an hour to see if it it would eventually come out of the freeze, but it clearly wasn't doing anything with the disk because the system remained frozen and I could not hear the disk heads moving (and on a 10K RPM drive, those are pretty loud). I ran memtest86+ and did a 3 minute S.M.A.R.T self-test on /dev/sda in Fedora, but oddly enough both came up clean.

Since my hardware seemed OK, I powered down the PC, opened the case and made sure there were no loose cables. Sure enough, the problem was the SATA cable which connected my motherboard to my hard disk. After disconnecting it, blowing off some excess dust and reconnecting it, everything was fine. But that's not where the story ends.

By the time I had reproduced the problem, tested the RAM & hard disk and reconnected the SATA cable, I had done about 15 power cycles. Linux handled the whole situation pretty gracefully - it logged the specific SATA errors (Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK) and put the root filesystem into read-only mode. After reconnecting the cable, Fedora was up and running as if nothing had happened (it did do an automatic fsck upon booting, but the check came up clean). Vista, on the other hand, didn't take it so well - it informed me that I need to run CHKDISK upon starting up, so I let it repair C:\ and it orphans thousands and thousands of files... After CHKDISK completed I was (surprisingly) able to boot up, but many programs - including explorer.exe - were crashing. Judging by the amount of orphaned files, I'm guessing that quite a few system files were missing or corrupted.

So, long story short, if you have any SATA problems and Vista starts orphaning a tons of files during CHKDISK, save yourself some time by canceling the CHKDISK and make sure you have your Vista installation DVD handy.

Rating: 

Coming soon...

Well, it's exam time so it's been a while since I last posted. Only 4 days left though! I'll be back with more stuff to post soon...

Rating: 
Tags: 

The infamous PNG gamma/color correction problem

PNG images are great for Web work, but there's one problem that was really getting on my nerves: the color correction problem. PNG images, like many other formats, support embedded ICC profiles for color management. For websites this feature can become a big hassle since some Internet browsers (namely, Safari 3.x and up) will adjust the gamma and colors of images according to their embedded profiles, but the colors defined in CSS stylesheets are viewed with the native color profile. So if an image with an embedded ICC profile is used in combination with "background: " rules defined in a CSS stylesheet, the image will not match the background color of the page!

Fortunately, GIMP is capable of converting an image's embedded profile into the sRGB profile which was designed for use on the Internet.

First, GIMP requires a bit of setup:

  1. Select the color profile for your display by selecting Edit > Preferences from the menu and clicking on the Color Management section
  2. Set Mode of Operation to Color managed display
  3. From the Monitor Profile drop-down box, choose Select color profile from disk... and select the ICC profile which is you are currently using (tip: On OS X, ICC profiles are stored in /Library/ColorSync)

Once GIMP has been informed about which ICC profile your display is using, it can convert embedded profiles to the sRGB workspace:

  1. Open the image you want to convert
  2. Select Image > Mode > Assign from the menu and ensure that the sRGB profile is currently assigned
  3. Select Image > Mode > Convert from the menu and select the ICC profile that your display is using (the same one you chose in the setup sets)
  4. Save the image and if applicable, pass it through pngcrush to make it smaller
Rating: 

Conficker

I have to admit, I'm pretty curious about what the giant botnet of Conficker-infected computers is going to start doing tomorrow. A large-scale denial of service attack is my first guess, but my instinct tells me there's something bigger in store... Either way, my clock currently reads 11:53PM so we're about to find out!

Edit: Did some quick research and it looks like the media hype got me. The only thing that's changing is the method which one variant (and not even the most popular one) receives new instructions.

Rating: 

File Fragmentation

The 500GB SATA drive in an external enclosure that I use for backups (eSATA/USB 2.0 connectivity) is currently NTFS-formatted for compatibility reasons. I would much prefer to use ext3 or HFS+, but it's pretty hard to get those two working correctly on all operating systems. Thanks to NTFS-3G and (Mac)Fuse, I can reliably access NTFS partitions on Linux, OS X and Windows (of course) so it's become my FS of choice when it comes to compatibility.

Unfortunately, that means that the drive becomes horribly fragmented (and pretty quickly, too). I decided to do a defrag today and found that the NTFS partition was 38% fragmented with 78% file fragmentation... Yuck. I'm going to be really happy when there's a filesystem that I can use on all operating systems that doesn't fragment or choke all the time. Ext2/3 was looking like a pretty good for the "doesn't fragment" part, but the ext2fsx project for OS X seems to have died out and ext2fsd, the only driver I've found for Windows that supports ext3 filesystems with inode sizes > 128, tends to bluescreen a lot. Back to waiting, I guess...

Rating: 

Motherboard poll

I realized that I had my Drupal permissions set wrong and users who were not registered could not vote (I have also disabled user registration for now). I fixed the settings so if you cannot see the voting options, just refresh the page and they should appear on bottom left side of the page. Please let me know who your favorite motherboard manufacturer is!

Rating: 

Installing GIMP on OS X

GIMP is a great program, but I always found it was a bit annoying to use on OS X (Leopard). First of all, whenever X11 starts, a new xterm window along with it. Besides that, when switching windows you need two clicks before GIMP (or any other program, really) registers the click and actually does something - the first click just switches the active window. Seeing as GIMP has it's tool palette in a separate window, this quickly became extremely irritating.

After a quick google, I found many sources saying that to disable xterm, I needed to copy /private/etc/X11/xinit/xinitrc to ~/.xinitrc and edit out the "xterm &" line inside. That's easy enough, but the only problem is that on Leopard with the latest X11 from XQuartz (2.3.2.1 at the time of writing) installed, /private/etc/X11/xinit/xinitrc doesn't exist! Although /usr/X11/lib/X11/xinit/xinitrc does, editing out all references to xterm doesn't work anyways. Instead, the app_to_run preference needs to be modified:

defaults write org.x.X11 app_to_run /usr/bin/true

/usr/bin/true is a command that does nothing (literally), so this essentially tells X11 to autostart nothing. I moved onto my next problem and found that to solve the two-clicks problem, the solution was to enable the "focus follows mouse" option like this:

defaults write org.x.x11 FocusFollowsMouse -string YES

I've been using that for a few months and I find it's still pretty annoying, but it's still less annoying than having to click twice on everything. Fortunately, I recently discovered the "wm_click_through" preference which is exactly what I had been looking for all along:

defaults write org.x.x11 FocusFollowsMouse -string NO
defaults write org.x.X11 wm_click_through -bool true

Now X11's window focus is back to normal, and clicking on inactive windows works as expected; it switches the window and activates the widget you clicked on. Problems solved!

Rating: 

New blog online!

Apart from having to design a new theme, my blog version 2 is up & running! Hope you enjoy it.

I'll be porting over the content from my previous setup into this one, but in the mean time you can access the old setup here: www.firewing1.com/v1

Update: The old content has been migrated, so the Joomla install at www.firewing1.com/v1 is now offline.

Rating: 

Facebook Terms of Use

The new facebook terms of use are just unbelievable. I first saw the story on Slashdot, but it's all over the web - Facebook owns everything you post, forever. Here's an excerpt from the official Facebook terms of use page:

You hereby grant Facebook an irrevocable, perpetual, non-exclusive, transferable, fully paid,
worldwide license (with the right to sublicense) to (a) use, copy, publish, stream, store, retain,
publicly perform or display, transmit, scan, reformat, modify, edit, frame, translate, excerpt,
adapt, create derivative works and distribute (through multiple tiers), any User Content you
(i) Post on or in connection with the Facebook Service or the promotion thereof subject only to
your privacy settings or (ii) enable a user to Post, including by offering a Share Link on your
website and (b) to use your name, likeness and image for any purpose, including commercial or
advertising, each of (a) and (b) on or in connection with the Facebook Service or the promotion
thereof. You represent and warrant that you have all rights and permissions to grant the foregoing
licenses.

So essentially, "I hereby grant Facebook the right to do anything they'd like with my pictures, comments and other media that I publish, including sublicensing that media, selling it, publishing it, or modifying it without having to compensate me." Nice. I'm not going to use Facebook until this is sorted out.

Please, join this group to show your concern. In the mean time, I've restricted my privacy settings - I recommend you do this too. Just click the Settings button at the top of your profile and remove all applications, disable Beacon and similar services as well as restrict everything to "Friends Only".

Rating: