Archive for the ‘MySQL’ tag
VPS Migration for thechriswalker.net – New Host, New OS, no Plesk
Not that I didn’t like Plesk. I just have the urge to understand things well, and I couldn’t understand all of how Plesk worked… So I wanted it “all-manual”, like the true hardcore (read: idiot) I am.
I had been using a VPS to host this website (amongst other things) and it was getting old. It ran on CentOS 4 and used Plesk as a control panel. PHP was down at version 4.2.2 or something and MySQL still at version 4.x. I didn’t understand server administration as well as I do now and the whole thing was a bit of a mess. So I decided a fresh start, with a VPS on more powerful hardware and built cleanly.
So I went for a basic VPS from 34SP.com with no control panel and using Ubuntu 9.04 as the OS. They set up the server quickly and so I went about configuring it how I wanted. There were a couple of snags along the road and so I’ll tell you about them here too.
Regular Expressions in MySQL
I like regular expressions. Anyone who has tried to understand them will understand the learning curve involved and in no way do I claim to be an expert. However, I use them all the time. They are possibly the most useful thing I have ever learnt to do with programming and are more powerful I imagined at first.
So what does this have to do with MySQL?
Well, I was recently dealing wit a table in which there is some inline JSON serialised data. This makes sense for the situation but of course if you want to query on something within the data you have to be a bit more careful. You have two options as I saw it yesterday:
- Pull all the data and parse it out outside of the database - which seems weak and inefficient.
- Use some LIKE query to pull likely candidates and then parse out of the data base - again not so good, but a bit better.