HOW-TO Install

  1. Download the install package, filename is mysql-noinstall-5.1.22-rc-win32.zip in this case.
  2. Extract it to the installation location, traditionally, the MySQL server uses “c:\mysql”, but my option is “e:\HTTPD\mysql”, any location you like is OK.
  3. Create your own config file, it’s a good idea to put this file in your MySQL server installation location, not the system path. You may create this file just containing a [mysqld] section:

    1
    2
    3
    4
    5
    [mysqld]
    # set basedir to your installation path
    basedir=E:\\HTTPD\\mysql
    # set datadir to the location of your data directory
    datadir=E:\\HTTPD\\mysql\\data
  4. Install MySQL as a Windows service, use the command:

    1
    2
    mysqld --install-manual MYSQL51 --defaults-file=e:\HTTPD\mysql\my.ini
    mysqld --install MYSQL51 --defaults-file=e:\HTTPD\mysql\my.ini

    Either of the above is ok, the difference is the first command will install the service started manually. “MYSQL51″ is the service name.

  5. Start the service, enter this command:

    1
    net start MYSQL51
  6. Now, all the steps are finished! You can use this:

    1
    mysql -u root

    to confirm your MySQL is running.

Notes

  1. MySQL looks for options first in the my.ini file, and then in the my.cnf file, so it’s better to name the config file my.ini
  2. You may just modify one of the my-*.ini files and rename it to my.ini, according to your situation.
  3. A root use is set by default, and no root password set. So DON’T use -p option in the command below until you’ve set a root password.

Some useful commands

1
2
3
4
5
6
REM Start MySQL server directly, not using Windows service
mysqld --consol
REM Shutdown MySQL server
mysqladmin -u root shutdown
REM Remove MySQL service
mysqld --remove MYSQL51