How to transfer a MySQL Database to a remote server

March 3, 2010

This tutorial will show you how to transfer your mysql databases to a remote server.  The databases will be directly transferred over TCP which removes the time spent downloading .sql files from your old server and re-uploading them to your new server.  This is the fastest way to transfer a MySQL database. This guide is written using linux commands but how to do the same thing on windows should be obvious.  If it isn’t, leave a comment below and I’ll explain step by step.

Preperation

The new server (the destination for the database) must be accepting connections on port 3306 to MySQL.  This is acheived using the following steps:

  • Edit it’s my.cnf file and ensure that the line “skip-networking” is removed
  • Ensure the server is accepting connections on port 3306:  “[]$ iptables -I INPUT -p tcp –dport 3306 -j ACCEPT”
  • Add a user to mysql who is authorised to connect from a remote IP.
    <mysql>: CREATE USER ‘transfer’@’[OLD SERVER IP]‘ IDENTIFIED BY ‘[PASSWORD]‘;
    <mysql>: GRANT ALL PRIVILAGES  ON *.* TO ‘transfer’@’[OLD SERVER IP]‘ WITH GRANT OPTION;
    Don’t forget to replace [OLD SERVER IP] and [PASSWORD] with your own values

Process

Now we will dump the data from our old server at [OLD SERVER IP] to the new server.  From a shell on our new server run the following command:
[]$ mysqldump -u[USER] -p[PASS] –all-databases | mysql -utransfer -p[PASSWORD] -h[NEW SERVER IP]

This command will then transfer all databases from [OLD SERVER IP] to [NEW SERVER IP].  Remember to delete the user ‘transfer’ from the mysql database for security reasons after this process is complete. For information on the mysqldump command see the mysqldump page and for any additional information please leave a comment below

Thanks
Stephen

Akinator, the Web Genius

January 14, 2010

Akinator, the Web Genius is a game of twenty questions where the person asking the questions rarely loses.  I found the link on a forum and was VERY surprised by his accuracy.

Think of a character, real or fictional and Akinator will almost certainly guess who, or what, you were thinking of.  Some of the characters Siobhan and I chose to test him and the results are below:
Lord Byron – yes
Gir (Invader Zim) – yes
Charlotte York (Sex and the city) – yes
Bart Simpson – yes
Doyle Brunson – no (Although he got it after 2 more questions)

I urge you to try it out and tell me of any particularly brilliant guesses below in the comments :)

Refilling Ink Cartridges

December 31, 2009

So, the time had finally come to replace my trusty HP DeskJet 5650’s colour ink cartridge.  It was the HP 57 cartridge that I needed so off I popped in the car to Argos to be greated with this price:
http://www.argos.co.uk/static/Product/partNumber/6813002/Trail/searchtext%3EHP+57.htm
£37.99 for a colour ink cartridge!!!  I was bewindered.  It is afterall just a small pot with ink inside it right?  All it has to do is give the printer some when it needs it and not leak in the meantime.   Anyway, to cut a long story short after a 5 mile drive to 3 different shops, i tried a different tact.

On ebay, the only option was “remanufactured” ink cartridges, which were alot cheaper, but I struggle to justify paying £10 for something that is “second hand” and could have been made by any old muppet with food colouring for ink.  A short while later I stumbled upon this:
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=330342162997&ssPageName=STRK:MEWNX:IT
Everything I needed to re-manufacture my own cartridges AND it even came with black ink so I was sold..

The package arrived this morning and I couldn’t wait to get home to try it out.
The picture on the left is the cartridge as it is bought new, and on the right is the cartridge ready to refill.

HP 57 Tri-colour ink cartridge

HP 57 Tri-colour ink cartridge

Cartridge with the sticker removed

Cartridge with the sticker removed

My logical mind associated the 3 columns of holes with the red/blue/yellow dots on the front of the cartridge.  As it happens, this was a mistake.  I reached for the “red” ink out of the packet, and without looking at any of the other inks or instructions began to fill my cartridge.  I then repeated the same for the second hole with the blue ink and reached for the last bottle of ink.  It was darker, much darker than the “red” ink I had used for the red hole so I immediately took a double-take, cursed and looked at the instructions.

The holes on the cartridge, actually make no sense at all and are Yellow, Red and Blue.  What this means is that I had correctly filled the yellow with yellow (I didn’t realise that though) and filled the red with blue.  I then tidyed up my many ink-spills and inserted the cartridge ready to see what damage I had done.  A test page revealed a strange result, the printer was fine.  The only problem is that the red was printing as a light-yellow.  I couldn’t for the life of me figure out what was wrong so the game began to try to empty the cartridge completely.

After 45 minutes over the sink, with ink on my hands, clothes, eyes, lips, teeth and all over the bathroom & many towels, I was ready to refill.  I took time to refill into the correct holes this time and now this is the point I am at now.  I now have a full cartridge that prints all solid colours fine (except red) but as soon as it comes to print anything remotely mixed, I get a lovely shade of shitty-brown rubbish….  My colour wheel now looks like a well tattooed tribemans arsehole and anything I print is ruined :( .

Morale of the story:  Always read instructions thoroughly before starting any job

Stephen

PS.  If anyone knows how I can make this better please comment below.

PPS.  4 hours until 2010 folks, Happy New Year!!

Pirated Windows 7 Review

December 3, 2009

No blogs for a long time, 2 months actually.. That’s so bad! Anyway, I feel a little guilty and hits are starting to drop off from this site, soooooooooo, I thought I’d share this little gem with you which made me chuckle this morning.

A Review of the Pirated Windows 7

Blogging frequency will improve when I get finished with my current-uber-secretive coding project :)

Stephen

Looking for bands for FREE studio time

October 1, 2009

Over the next 16 weeks I am offering somebody the chance to have pretty much unlimited FREE studio time in a Pro Tools HD3 studio in Newcastle with the intent of making a 2 track single for commercial release!

It is part of my college assignment to work with an external client to produce a recorded work in a distributable, duplicable form.

If you meet the following criteria, please leave a comment on this blog post with an email or web address and I’ll send you a message to discuss when we can get together to see if you fit the bill and we can arrange some dates:

  • Commercial: you must have material that you would expect to hear in the top 20 tomorrow. So no black metal, thrash punk, ambient/experimental, etc etc
  • Well rehearsed and able to perform the songs all the way through alone or together
  • Creative but able to take and respond to advice and criticism and suggest ideas to move a project in the right direction

Thanks, I look forward to hearing from you guys
Stephen

New photos!

September 24, 2009

As promised, I finally uploaded all of the Rabbit photos I have and also some others from Siobhan such as karting, the lakes and more..

See them here

Thanks
Stephen

Long time no post – a list of excuses!

Hello there,

It has been, at the last check, well over a month since I last updated my blog.  I have also not updated any of my other websites for this same period of time, and I thought that if I posted a blog and tried to justify why; it might just make me realise that there’s no good reason for this.

Drag Racer is still going from strength to strength in terms of user numbers but the morale of the regular users is suffering due to the lack of updates and involvement that I have been offering them.

This blog is still delivering impressive user numbers too despite the lack of content that I am injecting into it.  It is very low-maintenance and I will have to try to make it my first visit on my daily web-browse so that I am more motivated to post blogs.

So, a little background.  At the moment, Siobhan and I have been very busy not doing a great deal.  Siobhan just started uni at Newcastle University (congrats) and I am recommencing my second year of my Degree at Newcastle College.  We have just recently bought two rabbits, which are in the process of being trained to be given the free roam of the house, but this is proving difficult. I will probably put up some photos of the two little terrors on the Photo section very soon.

Since my Hackintosh had it’s harddrive faliure, I have found it really difficult to be motivated to spend 6, 7 or 8 hours in front of a PC writing hundreds and thousands of lines of code.  I seem to have found a much better pastime in losing at online poker!  This is going to change though, and I will not be playing poker online for atleast a few months now until Siobhan and I are more sorted with the furnishings for the flat, etc.

I have also just recently started a new job, at TK Maxx newcastle (lol), which doesn’t take a great deal of my time (16-25 hours per week), but now means that most of the time that I spent alone, and did most of my coding, (weekends while Siobhan was at work) are now occupied.

I hope this provides a good insight of why there has been a lack of activity around here and I apologise for this!

Thanks
Stephen

Hackintosh is back!!!

August 17, 2009

As some of you more regular readers may have noticed, I am back from a period of absence.  This is mainly due to my main PC (my Hackintosh) having a little harddrive trouble.

I don’t know what caused it, but all of a sudden, after a stint in Windows, located on the same harddrive as MacOS, the MacOS partition refused to play nice and took 15 minutes or so to boot.  I tried everything to get to the bottom of it and there were no errors shown in the verbose boot or system.log

Eventually, after un-overclocking the rig, I ruled out all hardware besides the Harddrive.  Windows was having a little bit of a grumble about that too and partition magic identified a number of “boot sector problems” which it fixed.  As this didn’t fix my OSX issue, it was time to dig deeper.

Off I popped and booted my iAtkos install DVD and launched “Disk Utility”. This identified a number of problems

  • Invalid volume file count
  • Invalid volume directory count
  • Missing thread record

I then set it away for an hour doing a command something along the lines of:

fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y &&fsck_hfs /dev/diskXsY -f -y && … …

but that didn’t help me either.

After a little Googling, I found that Disk Warrior was the solution, so I burned it to a DVD and tried to boot.. D’oh!  My Hackintosh can’t boot OSX native DVDs and it took me a few days to work this out.. stupid.. I tried to launch Disk Warrior from within OSX but it wouldn’t do any of the fancy stuff to the disk as it was in use.

Sooooo.. After playing with the Chameleon bootloader for a few days and giving up on that route, I had to take drastic action.

I did a little reshuffling of my harddrives and made room for a partition.  I then installed ANOTHER copy of iAtkos onto this and booted into that partition.  On this partition I installed Disk Warrior.  FINALLY I was able to repair the disk and this is where I am now.  I had a quick read through the files that were damaged/deleted and there were a few worrying ones in /System/Library/Extensions that were deleted and the rest were all chinese user manuals and recovered files.  These didn’t bother me too much so I booted and all is well, so far.

I hope this wee guide helps somebody diagnose there problem faster than me and I hope this will see me returning to the internetz more!

Thanks
Stephen

Using OpenDNS for reliable, feature rich DNS

July 12, 2009

Yesterday and today I was annoyed to find that some of my domains had disappeared from the face of the earth.  Others that were assigned to the same server were responding normally and the server was up and functioning fine.  At first I thought it must be a problem relating to Godaddy DNS services (they host my DNS) which would pass.  After 12 or so hours, the problem hadn’t went away so I looked for another solution.  After a quick google search for alternative DNS solutions I stumbled upon the OpenDNS project.  The goal of OpenDNS is simple:

OpenDNS is a better DNS service. We make your Internet safer, faster, smarter and more reliable. It’s free, and there’s nothing to download.

So I went ahead and switched my DNS IPs to 208.67.222.222 and 208.67.220.220 (if you don’t know how to do this post a comment below and I’ll reply with a guide :) ).  Straight away a ping to www.groomi.net showed that the problem was with Virgin Media’s crappy DNS servers.

One thing that annoyed me though, was OpenDNS’ money-making method.  I mis-typed a web address and was instantly greeted with an ugly search page littered with banners: http://guide.opendns.com/?url=www.qwertyuiop.  This alone was enough to put me off using OpenDNS until I discovered that you can register an account at OpenDNS.com which allows you to disable this feature, track your DNS traffic,  Enable/Disable content filtering + phishing protection and much more.

Since finding this I am very happy with the service that OpenDNS offer and would reccomend it to anyone!

Long time no blog

July 5, 2009

I must apologise for my lack of blogging lately. It has been over a month and a very busy one at that!

Over the last month I finally moved in with my girlfriend Siobhan! We have a cool little 2-bed flat in Hebburn and having our own place is absolutely brilliant!

This is a very uninteresting blog but it is just word to let you know that I am still here and will start posting as soon as I have something interesting to post about! I’m sure you guys don’t want to hear about our lovely new bed linen and wardrobe…

I have just started to learn socket programming in flash and I am intending to develop my second Facebook application over the summer. Watch this space :)