安装完mysql后,紧接着是利用Mysql server instance config wizard安装mysql服务。由于要自定义data,log,binlog的目录,利用那个wizard还要对my.ini再作一次修改。这里通过手动安装mysql服务,个人感觉更方便。
在windows(or winnt)下新建my.ini文件,内容如下(当然你可以对配置文件作适当修改,以适应你自己的mysql数据库,这里是以innodb作数据库引擎的):
[mysql]
default-character-set=utf8
[mysqld]
server-id=1
basedir=C:/Program Files/MySQL/MySQL Server 5.0
datadir=C:/Program Files/MySQL/MySQL Server 5.0/data
innodb_data_home_dir=”D:/MySQL Datafiles/data”
innodb_data_file_path = ibdata2:100M:autoextend:max:2000M
innodb_log_group_home_dir = “D:/MySQL Datafiles/log/”
innodb_log_arch_dir = “D:/MySQL Datafiles/log/”
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=1M
innodb_buffer_pool_size=64M
innodb_log_file_size=14M
innodb_thread_concurrency=8
log-bin = “D:/MySQL Datafiles/binlog/binlog”
log-bin-index = “D:/MySQL Datafiles/binlog/binlog.index”
binlog-do-db=userresdb
set-variable=max_allowed_packet=5M
default-character-set=utf8
default-storage-engine=INNODB
sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
max_connections=160
query_cache_size=22M
table_cache=320
tmp_table_size=26M
thread_cache_size=8
[WinMySQLadmin]
Server= C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqld-nt.exe
user=root
password=root
[Client]
user=root
password=root
port=3306
回到windows命令行,转到mysql安装目录下的bin目录,执行
mysqld install mysql
服务安装成功,启动服务
net start mysql
启动成功
输入mysql,进入mysql命令行,现在就可以操作数据库啦!