Categories
Uncategorized

Setting Up for TechDays Montreal

TechDays is no small undertaking: it’s a seven-city two-day conference tour with over 40 sessions featuring content from the TechEd North America 2009 conference and delivered by local and “imported” speakers (we try to get local speakers) to hundreds of developers and IT pros in each city. Montreal was the fifth stop on the tour, and I thought I’d show you some behind-the-scenes stuff that took place on Tuesday, the day before TechDays Montreal took place.

Keep in mind that what you’re seeing here is the setup for the conference’s technical content and only a small portion of what goes on to make TechDays happen. In a later entry, I’ll show you photos of that many other people who make Techdays run smoothly: the event coordinators, A/V team, benue staff, and Windows lounge volunteers.

Tuesday started with a hearty breakfast at Dunn’s, which I enjoyed with my coworkers Rick Claus, Pierre Roman, Christian Beauclair and my road trip buddy Damir Bersinic

01 dunns

With hunger satisfied, it was time to make our way to the Centre Mont-Royal to transform the place into TechDays Montreal. Here’s one of the smaller rooms, just after the A/V setup and before the chairs were rolled in:

02 Cartier 1

TechDays Montreal was sold out, so we had to provide overflow seating outside the rooms, just in case. At Techdays, we place a large monitor outside every room with a live feed to the audio and video from the presentation.

03 overflow seating

Here’s one of the larger theatres. Some of our sessions could easily pack one of these rooms.

04 large theater

It meets with Christian’s approval:

05 christian approves

We TechDays organizers aren’t just a bunch of pretty faces: we move our own gear (and remember, we need enough computers and ancillary equipment to support over 40 tech demos!). So it was off to the loading dock to get the demo machines – assuming we survive the cargo elevator ride. Here’s a photo of Pierre learning why dangling clothing and cargo elevators where you have direct exposure to the elevator shaft don’t mix:

06 maudit ascenseur

“Sixteen years at the company and I still don’t have any roadies! I wonder if Ballmer has to lug his own demo gear….”

07 christian and hand truck

“Why’d this thing get so heavy all of a sudden?”

08 why is this so heavy

The answer, of course, is Pierre:

09 pierre on cart

Conference wifi is a very expensive proposition, with many venues asking for hundreds of dollars per user. In order to keep the cost of TechDays affordable (early bird registration is under $300, which is a steal). we decided to forgo the conference wifi and provide internet kiosks instead. The kiosks were Dell laptops, which we had to initialize with clean copies of Windows 7 with both French and English settings.

To make setup simpler, we laid out the machines in a row and worked on them in assembly line fashion, each one of us performing a specific task to set up the machine. I was step 1: boot up, delete old virtual hard drive, and copy new virtual hard drive from the appropriate USB key…

12a usb keys

to various machines, starting with these ones…

10 trio of dells

…after which I moved on to these machines…

11 row of dells

…and then these machines:

12 even more machines

…and of course, there’s the matter of setting up the machines that would be used in the presentations.

13 starting setup

I had to duck out of the setup room for a little bit to record the Developer Night in Canada podcast with John Bristowe – we were doing an interview with the folks at Habanero Consulting Group:

podcast

Dell is our hardware sponsor, and they provided an assortment of computers, from the netbooks, which were used as secondary PowerPoint machines, to the copper-coloured “Dellasaurus” machines, big honking laptops with serious horsepower for sever demos:

14 machines in crates

Here’s Pierre doing some setup with Christian shoulder-surfing:

15 pierre is leeeroy jenkins

Here’s Rick, who can sometimes kill technology by just looking at it, pleased that his setup works:

16 rick claus

And finally, a photo of the last two machines to be set up: the rig for the lunchtime demos:

17 lunchroom

This article also appears in Canadian Developer Connection.

Categories
Uncategorized

Installing MySQL Server 5.1 on Windows

MySQL dolphin balancing Windows "ball" logo on its snout

You’ve probably heard of Microsoft’s Web Platform Installer, a free-as-in-beer tool that makes it a snap to install a variety of Microsoft and Open Source web applications and development tools, ranging from “The Usual Suspects”, such as Visual Web Developer, IIS and SQL Server 2008 Express to stuff you might not expect, such as PHP and WordPress. It makes installing these goodies a simple of matter of checking the items you want and clicking the Install button. (While the old way of installing PHP on Windows wasn’t rocket science, it involved enough steps and configuration changes to justify my writing a whole article on the topic in an old developer blog of mine.)

One necessary thing that the Web Platform Installer doesn’t do for you – and I assume it’s because of licensing restrictions of one kind or another – is install MySQL, which many PHP apps, including a number that the Web Platform Installer installs, use. You’ll be told that you need to install MySQL, but it leaves installing it up to you.

Hence this article, where I walk through the steps of installing MySQL Server 5.1 on Windows for a developer machine. Whether you just need PHP and MySQL so that you can experiment with WordPress template designs or are the “I build on Windows, but deploy on Linux” type or are developing for a server setup where IIS is serving both ASP.NET and PHP apps (and yes, IIS does that!), you’re going to want MySQL on your dev box.

Get the Installer

The version we’re interested in is the free-as-in-both-speech-and-beer Community Edition, which is available at the MySQL site. Here are the links to the installers:

Both these options provide you with three different installers. I recommend getting the .msi (Windows Installer) as it’s the lowest-headache option. It’s also the version I use in this walkthrough.

By the way, the screenshots provided in this walkthrough are from my actual installation process on my laptop, which runs the 64-bit edition of Windows 7 Beta, Build 7000 (I’m not installing the Release Candidate until later this week). I’m installing the 64-bit version of MySQL Server 5.1 Community Edition, but whether you’re installing the 32- or 64-bit version on Windows XP, Vista or 7, your experience should be roughly the same.

Here’s what you should see when you launch the installer:

01

Which Setup Type?

The first choice you have to make is the type of setup you want:

02

The three choices offered are:

  1. Typical: Installs the basic components for MySQL to the default installation path, C:\Program Files\MySQL\MySQL Server 5.1\, including:
    • The MySQL server
    • The mysql command-line client
    • Other command-line utilities like mysqldump, myisamchk and more.
  2. Complete: Installs all the MySQL components to the default installation path, C:\Program Files\MySQL\MySQL Server 5.1\, including those listed in the Typical setup, plus:
    • Documentation
    • The embedded server library
    • The benchmark suite
    • Support scripts
  3. Custom: Gives you complete control over the components installed and the installation path.

Although the components in the Typical setup will work fine for most web development purposes, I like having the docs handy, so I went with the Complete setup.

Once you’ve selected the setup, you’ll be shown a confirmation window like the one below:

 03

Once MySQL has been installed, you’ll see the window below:

 04

You’ll be given the choice to configure MySQL server, which I recommend. You can do so by leaving the Configure the MySQL Server now checkbox checked and then clicking Finish.

The Configuration Wizard

Here’s the first window of the Configuration Wizard:

 05

Which Configuration?

You’ll be asked which configuration type to use:

 06

The two choices offered are:

  1. Detailed Configuration: Gives you fine-grained control over the configuration process. I’m familiar with the options being offered, so this is the option I chose. If you choose this option, you will have to make some additional choices in the windows that follow.
  2. Standard Configuration: If you’re new to MySQL and need a server configured as a single-user developer machine, this configuration should suit your needs. If you choose this option, you’ll skip the next few steps and go directly to the Root Password window.

Detailed Configuration Options

If you chose to use the Detailed Configuration, you will see the following windows.

Server Type

The first choice in the Detailed Configuration is Server Type:

 07

The three options are:

  1. Developer Machine: This setup assumes that MySQL will be running on a machine used to write applications, where the database will be used for basic developer proofs of concept and simple testing. MySQL will be configured to use minimal system resources. This is the option I selected.
  2. Server Machine: This setup is for server systems where MySQL will be running along with other server applications such as a web server, mail server, FTP server and so on. MySQL will be configured to use a moderate portion of the system resources.
  3. Dedicated MySQL Server Machine: This is for machines that will be running only MySQL. in this configuration, MySQL will be configured to use all available system resources.

Storage Engines

The next choice to make is selecting the storage engines to be used: MyISAM or InnoDB. If you’re not familiar with MySQL, you’re probably asking “What’s the difference between InnoDB and MyISAM?”

Of the two engines, MyISAM is the older of the two, and the default engine. The general consensus is that in most cases, it’s faster than InnoDB for typical CRUD operations. It supports up to around 4 billion rows of data and 64 indexed fields per table. MyISAM uses table-level locking, which means than when a row is being updated, the table is locked and no other operations can update any other rows until the first row is updated and the lock on the table is released.

InnoDB is the newer (and some would say sexier) engine. It’s called “the transactional one”, and it’s built with data integrity in mind. It supports foreign key constraints, meaning that changes to a table (say, “Actors”) that references another table (say, “Movies”) are allowed only if those changes leave both in a valid state. For example, you wouldn’t be able to delete a row from the “Actors” table if it referenced any rows in the “Movies” table (that is, you can’t remove an actor from the database if s/he’s listed as starring in any movies). It also supports row-level locking, which means that so that more than one row can be updated at the same time.

The general guidelines for choosing between MyISAM and InnoDB are as follows:

  • Will your use of the database be mostly reading? That is, will you be doing mostly select operations and few insert, update and delete operations? Then you want MyISAM.
  • Will your use of the database involve at least as many writes as reads, if not more? That is, will you be doing as many insert, update and delete operations as select operations? Then you want InnoDB.
  • Do you need full-text search? You want MyISAM.
  • Do you need to conserve disk space and RAM? You want MyISAM.
  • Does the idea of using a non-SQL Server database irk you? You might feel better going with InnoDB, since it has the row-level locking, transaction safety and generally more “relational” feel.

Keep in mind that when adding a table to a MySQL database, you can specify which engine it uses. Lately, I’ve been in the habit of specifying InnoDB for most tables except those on which I want to provide full-text search; for those, I’ve specified MyISAM. (For more on specifying engines when creating tables, see MySQL’s page on the create table command.)

Now that I’ve done a quick review of MyISAM and InnoDB, let’s look at the storage engine choices that the Configuration Wizard offers.

 08

The three choices are:

  1. Multifunctional Database: This enables both InnoDB and MyISAM storage engines and divides resources evenly between the two. This is the recommended option for developers who use both storage engines on a regular basis. It’s the option I chose, since it yields the most flexibility.
  2. Transactional Database Only: This enables both InnoDB and MyISAM storage engines, but dedicates more resources to the InnoDB engine.
  3. Non-Transactional Database Only: This option completely disables InnoDB; all resources are dedicated to the MyISAM storage engine.

If you chose Multifunctional Database or Transactional Database Only, you’ll be presented a windows asking you where to put the InnoDB tablespace:

 09

I went with the default, which puts the tablespace in the MySQL installation directory.

Concurrent Connection Settings

The next window is all about the number of concurrent connections supported:

 10

The three choices offered are:

  1. Decision Support (DSS)/OLAP: This assumes an average of around 20 concurrent connections, with a maximum of 100 concurrent connections supports. I chose this option, as it works for most development scenarios.
  2. Online Transaction Processing: This supports up to 500 concurrent connections and is generally for production use.
  3. Manual Setting: This lets you specify a specific number of connections. I’ve seen it used mostly for testing.

Networking Options

The next window concerns itself with networking options:

11

Port 3306 is the default MySQL port, so that’s what I went with; I also checked the Add firewall exception for this port checkbox. I also left the Enable Strict Mode checkbox checked.

Default Character Encoding

Now it’s time to select the default character encoding:

 12

You’re given a number of options, but I suggest you go with my choice. I chose UTF-8 because it’s the encoding of the Web.

Service Options

Here’s the next window:

 13

I strongly recommend:

  • Checking the Install As Windows Service checkbox. When installed as a Windows service, MySQL can be started automatically at system startup and restarted in the event of a service failure.
  • Going with the default service name of MySQL unless there’s already an instance of MySQL installed, in which case you’ll want to provide a different name. Note that service names should be 255 characters or less and can have any legal character except for the forward-slash (/) or backslash (/).
  • Checking the Launch the MySQL Server automatically checkbox.
  • Checking the Include Bin Directory in Windows PATH checkbox. You’ll save yourself a lot of typing if you do this.

Security Options

And now, the Security Options window…

 14

You’ll be asked to provide a password for the root user twice.

You can also choose to:

  • Enable root access from remote machines. I don’t really need this on my development machine, so I didn’t check this checkbox.
  • Create an anonymous account. I don’t need this either, so I didn’t check this checkbox.

Go!

That’s it for all the option setting. You’ll now be presented with this window:

 15

If you’re satisfied with your configuration choices in the previous windows, click the Execute button. You’ll be presented with this window as your reward:

 16

…and you’re done!

Taking it for a Quick Spin

Let’s take MySQL for a quick spin to confirm it’s working. We’ll do this using the mysql command-line client and logging in as root. There are a couple of ways to do this. One is by firing up the MySQL Command Line Client from your Windows menu (or Start Menu on XP):

start_menu

A command-line window will pop up, where you’ll be prompted to enter the root password. Enter it, and you’ll be in the command-line client!

prompt_01

The other way is to fire up the Command Prompt and (if you specified that you wanted MySQL’s bin directory included in Windows’ PATH, which you should have), enter mysql –u root –p. The -u switch is for specifying a username, and the -p switch is for specifying that you will be providing a password for the specified username.

You’ll be prompted to enter a password. Enter the root password and you’ll be in the command-line client:

prompt_02 

And MySQL is ready to use! You can now use the Web Platform Installer to install PHP-based apps that require MySQL.

I can’t give you a walkthrough of MySQL’s command line – that’ll have to wait for another article, or you might want to check out this article – but here’s a quick one: the show databases; command (don’t forget the semicolon at the end!) will return a list of all the databases currently in the system.

Happy MySQLing!