日期:2014-05-16  浏览次数:20493 次

mysq绿色版安装
下载绿色版的mysql5.5.9
解压到 D:\development\

命令行进入该目录
先测试一下能不能用

bin\mysqld --console

成功后就启动了mysql程序。

再打开个命令行
bin\mysql -uroot -p

这里密码默认为空,直接回车就可以了
登陆成功后可以修改密码

安装mysql服务到系统:
bin\mysqld --install mysql55--defaults-file="D:\development\mysql\my.ini"

启动服务
net start mysql55

停止服务:
net stop mysql55

删除服务:
bin\mysqld --remove mysql55


my.ini如下:

[client]
port=33067

[mysql]


[mysqld]
port=33067
innodb_flush_log_at_trx_commit=2
interactive_timeout=3600
wait_timeout=3600

default-storage-engine=innodb
max_connections=100
tmp_table_size=35M
thread_cache_size=4
query_cache_size=0
table_open_cache =256

#basedir=..\
#datadir=..\data\
#table_cache=256

#*** MyISAM Specific options
key_buffer_size = 64M
myisam_sort_buffer_size = 16M
max_allowed_packet = 1M
sort_buffer_size = 256K
read_buffer_size = 256K
read_rnd_buffer_size = 1M

#*** INNODB Specific options ***
innodb_buffer_pool_size = 256M
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_additional_mem_pool_size = 20M
innodb_lock_wait_timeout = 50
innodb_thread_concurrency=4
#innodb_data_home_dir=..\data\

basedir=D:\development\mysql
datadir=D:\development\mysql\data


安装bat脚本:

set SugarNMS_HOME=%cd%
net stop mysql55
%SugarNMS_HOME%\bin\mysqld --remove mysql55
%SugarNMS_HOME%\bin\mysqld --install mysql55 --defaults-file="%SugarNMS_HOME%\my.ini"
echo Try to start the mysql55 deamon as service ... 
net start mysql55