---
title: "MySql noinstall-5.1.34-win32 配置"
author: "wuhui"
date: "2009-10-10T11:39:15Z"
tags: [".net", "C", "DOS", "MySQL", "Windows"]
slug: "mysql-noinstall-5-1-34-win32"
draft: false
lastmod: "2009-10-10T11:39:15Z"
id: 484260
url: "https://wuhui.iteye.com/blog/484260"
---

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），选择其中一个适合自己机子的配置文件。假设选择了my-medium.ini，拷贝到目录C:\WINDOWS，改名为my.ini，并在含有[mysqld]部分的选项文件，指定basedir和datadir参数的值：

# 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

请注意在选项文件中使用正斜线儿不是反斜线指定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命令行窗口，进入到目录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.

