1、下载
下载地址是:http://dev.mysql.com/downloads/mysql/5.1.html#win32
选择 Without installer (unzip in C:\)5.1.39112.6M 这个进行下载
2、解压
解压到一个你指定的地方,最好别放在系统盘,不然操作系统一出问题.....
3、启动数据库
首先进入命令行窗口(注意,进入你的解压的路径,不一定和我的相同)
d:
cd D:\Program Files\mysql-5.1.39-win32\bin
D:\Program Files\mysql-5.1.39-win32\bin>mysqld --console
执行完上述操作后,你会看到
090929 22:13:43 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
090929 22:13:43 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
090929 22:13:43 InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
090929 22:13:43 InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
090929 22:13:44 InnoDB: Started; log sequence number 0 0
090929 22:13:45 [Note] Event Scheduler: Loaded 0 events
090929 22:13:45 [Note] mysqld: ready for connections.
Version: '5.1.39-community' socket: '' port: 3306 MySQL Community Server (GPL
)
D:\Program Files\mysql-5.1.39-win32\bin>mysqlshow
mysqlshow: Can't connect to MySQL server on 'localhost' (10061)
6、创建 option file 来配置你的 mysql路径和数据路径
在 C:\WINDOWS 下,创建文件 my.ini
文件内容为:
[mysqld]
# set basedir to your installation path
basedir=D:/Program Files/mysql-5.1.39-win32
# set datadir to the location of your data directory
datadir=D:/Program Files/mysql-5.1.39-win32/data
注意:路径用/分隔,如果用\,则要写两个,即\\
7、从命令行连接到mysql
D:\Program Files\mysql-5.1.39-win32\bin>mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.39-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql会提示你输入密码
Enter password:
什么也别输入,直接回车即可。(至于说在哪里设置用户名及密码,俺还不知道......慢慢学了)