Installing MySQL as a service
Downloading MySQL for Windows
You can find the binary of MySQL at:
http://www.mysql.com/downloads/mysql-3.23.html [
direct link]. The file is 12.1 MB, and is distributed as a single zipped file.
Installing MySQL
I love installing MySQL because of its straightforwardness. It's a nice break
from all this configuration file mumbo jumbo that we've been working with.
All you need to do is unzip the
mysql-3.23.51-win.zip file to a folder
(
C:Temporary for all I care) and then execute the
setup.exe program. I'd guess that the hardest part of the entire installation is deciding
where you want to install to. I picked
H:mysql, but you
can choose whatever you want.
Configuring MySQL
Editing your my.ini
Create a new file in
Notepad and copy these three lines into it.
[mysqld]
basedir = H:/mysql/
datadir = H:/mysql/data/
Change the
basedir
and
datadir
to suit your actual
installation, using mine as a model. Then, save the file as
my.ini and place it in your
C:WINNT directory, so that the full path of
the file is
C:WINNTmy.ini. You can close the file now.
Running as a service
Start up the
Command Prompt and wait until you see
C:>.
Switch to the drive you installed MySQL to by typing
h: and then
Enter. To switch to MySQL's
bin directory, type
cd
mysqlbin and hit
Enter. To install MySQL as a service
under Windows 2000/XP, type
mysqld-nt -install and hit
Enter.
You should see a screen similar to the one below, with a message letting you
know that the service was successfully installed.
At this point, you can restart your computer. You
could forge ahead
without restarting by typing
net start mysql and then pressing
Enter. What you'll see is a message confirming that the MySQL
service was started successfully. It looks strikingly and amazingly similar
to the one below.
Messing with the settings
To change the default MySQL password, enter the
mysqladmin -u root password
"myNewPass1488" command from the
H:mysqlbin directory.
Change
myNewPass1488 to a
real password of your choosing.
To make sure that the change went through, type
mysqladmin -u root reload and hit
Enter. What you want is a message telling you that access
was denied.
Let's just play with one more thing before calling it a night (which has no
doubt turned back into day by now). Type
mysqladmin -u root -p status and press
Enter, and then type in your password when prompted.
You'll see some basic information about the currently-running service.
To shut down MySQL, type
mysqladmin -u root -p shutdown and hit
Enter. Enter your password, press
Enter again, and
then close the
Command Prompt window. And that's that for MySQL!
Page 5:
Final comments and instructions