1. Get the MySQL program. The appropriate version of MySQL can be downloaded from the official Oracle Web site. I got the MySQL file for: mysql-5.5.29-win32.zip;
2. Unzip the compressed package to the desired directory. Here I extract to D:devmysql (note folder name must not exist in space, the simpler the better!!) );
3. Add the D:devmysqlbin directory to the environment variable Path;
4. According to your application needs and system environment, select a profile, named "My.ini", and then modify some of the contents in this file as follows:
[Client]
Default-character-set = UTF8
[Mysqld]
# set Basedir to your installation path
Basedir = D:/dev/mysql
# set DataDir to your data directory
DataDir = D:/dev/mysql/data
Character_set_server = UTF8
#default-character-set = UTF8
# here is mysqld bug, can't use Default-character-set
[MySQL]
Default-character-set = UTF8
5. Install MySQL as a Windows service. At the command line, enter the following command:
CD D:devmysqlbin
Mysqld-install MySQL--defaults-file=d:devmysqlmy.ini
Installation completed.
Test installation:
1) Start MySQL:
net start MySQL
MySQL Normal startup;
2) Login MySQL:
Mysql-u root-h Localhost-p
Can log on normally. Note that the root password is empty at this time;
To change the password, please exit the MySQL command line mode and enter the following command:
mysqladmin-u root-p Password "NewPassword"
MySQL installation was successful.