1. 解壓mysql-noinstall-5.1.34-win32.zip 到你喜歡的目錄,例如:E:\soft_install\mysql-5.1.34-win32
2. 在根目錄E:\soft_install\mysql-5.1.34-win32中有五個配置信息文件:my-small.ini (memory <= 64M),my-medium.ini (memory 128M ),my-large.ini (memory 512M), my-huge.ini (memory 1G-2G),my-innodb-heavy-4G.ini (memory 4GB),選擇其中一個適合自己機(jī)子的配置文件。假設(shè)選擇了my-medium.ini,拷貝到目錄C:\WINDOWS,改名為my.ini,并在含有[mysqld]部分的選項(xiàng)文件,指定basedir和datadir參數(shù)的值:
# set basedir to your installation path
basedir=E:/soft_install/mysql-5.1.34-win32
# set datadir to the *** of your data directory
datadir=E:/soft_install/mysql-5.1.34-win32/data
請注意在選項(xiàng)文件中使用正斜線兒不是反斜線指定Windows路徑名。如果使用反斜線,必須用雙反斜線:
[mysqld]
# set basedir to your installation path
basedir=E:\\soft_install\\mysql-5.1.34-win32
# set datadir to the location of your data directory
datadir=E:\\soft_install\\mysql-5.1.34-win32\\data
3. 打開dos命令行窗口,進(jìn)入到目錄E:\soft_install\mysql-5.1.34-win32\bin>
E:\soft_install\mysql-5.1.34-win32\bin>mysqld install
Service successfully installed.
E:\soft_install\mysql-5.1.34-win32\bin>net start mysql
The MySQL service is starting.
The MySQL service was started successfully.
E:\soft_install\mysql-5.1.34-win32\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.34-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> exit
Bye
E:\soft_install\mysql-5.1.34-win32\bin>net stop mysql
The MySQL service is stopping.
The MySQL service was stopped successfully.
E:\soft_install\mysql-5.1.34-win32\bin>mysqld remove
Service successfully removed.