Skip to main content

What follows are instructions for building and installing MySQL 5 on Ubuntu. These instructions should work perfectly on both Feisty (7.04) and Gutsy (7.10).

If you're a pro at this type of thing already, if you're impatient, or just feeling lucky, just shut the fuck up and read through to the end. It's not that complicated, and nobody cares about your l33t skillz anyway.

Why you don't want to build MySQL yourself

  1. You don't have to. Experts have already built and optimized an installer that integrates with the rest of your system. And by "experts," I mean "people way fucking smarter than you." And by "integrates with the rest of your system," I mean it puts configuration files in the right place, it starts up the service the right way, and most importantly, it integrates with your system's upgrade manager so you'll get security updates automatically.
  2. It totally sucks having one-off standalone installations of software. Why? Because when some fucker finds a security hole in the version you compiled yourself, it'll be up to you to recompile and reconfigure your software. Yourself. Oh, and the fucker won't tell you that you need to do it. You'll have to go out onto the wild, wooly interweb and subscribe to BugTraq or SecurityFocus or some dumb-ass developer mailing list. Does that sound like fun? Huh, does it punk?
  3. http://funroll-loops.org/">Watching shit scroll by for hours does not make you a UNIX expert overnight.

Prerequisites

None. That's right, none. Your Ubuntu "desktop" is fully capable of installing and running hundreds of different "server" programs. You don't need to buy a special "server" version for $1000. Other things you don't need: a compiler or a bunch of developer tools. And you sure as fuck don't need to sign up for some confusing "developer program" that forces you to surrender your rights and your personal information.

Terminal

We're not going to be typing archaic commands into a window like they do in the movies. Sorry to disappoint you. That shit's reserved for impressing boy toys and dumb blondes. Have you ever been fucking a blonde up the ass and then, like, pushed her face into your monitor filled with a maximized terminal window and shouted "SUDO MAKE ME A SANDWICH, BITCH!" That's hawt. But I digress...

Setting the path

Do not skip this step! Most everything else will fail if you do.

No, I'm just kidding. There's nothing to this step either.

Download, extract, etc.

Run Synaptic Package Manager. Click Search and type mysql server. Select the mysql-server-5.0 package. A dialog will pop up saying that installing the MySQL Server package requires installing a bunch of other packages too. See how it did that? It's called dependency management, and it's built into all modern Linux distributions. Computers are smart like that. Click Apply and Ubuntu will download, extract, and install everything for you. Along the way it will ask you to enter a password for the MySQL "root" user. You should do that. Blank passwords are bad, mmkay?

Auto-starting MySQL

Nothing to do here. Ubuntu set this part up for you too, because, you know, it's a server thingie, and server thingies are supposed to start automatically. Computers are smart like that.

Starting and stopping MySQL manually

From your System menu, run Services and check or uncheck Database server (mysql). Sorry, still no terminal required.

A note about security

The package installer automatically set up MySQL so that it can only be accessed from your local machine, which is almost certainly what you want. Don't go fucking around with strange configuration files. They won't respect you in the morning.

Updating MySQL in the event of a security hole

Your installation of MySQL Server is automatically integrated with Ubuntu's update manager. If there is a security problem with MySQL Server, Ubuntu will notify you with a cute little bubble alert as soon as a fix is available. Don't be a dumbass; always install security updates promptly. The updater will take care of stopping and restarting your MySQL service and all that shit. Just clicky clicky and go back to watching "Ow My Balls."

Uninstalling MySQL

Run Synaptic Package Manager, click Status, then Installed, uncheck the mysql-server-5.0 package, and click Apply.

My sincerest apologies...

...to Dan Benjamin, who is a very nice chap and doesn't deserve this sort of snark. But Jesus H. Christ, it must suck giant wet donkey balls to be stuck on an archaic OS where you need to be dropping into the terminal and tweaking configuration files and compiling shit all the time. I hope the translucent menu bar is worth it. But please, please stay up to date with MySQL security patches; I wasn't kidding about that, it's really fucking important.

§