1、下载Mysql并解压缩,个人建议路径全英文,如d:\GreenTools\mysql
2、将mysql\data目录复制到准备存放数据库的地方,如e:\DB\mysql
3、修改mysql\my.ini,主要是修改数据库目录和编码格式
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
datadir="E:/DB/mysql/" 【修改这里为第2步指定的数据库目录】
character-set-server=utf8 【编码,一般为utf8】
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
4、启动mysql服务
【安装服务】
在命令行输入
d:\mysql\bin\mysqld -install
net start mysql
【卸载服务】
在命令行输入
net stop mysql
d:\mysql\bin\mysqld -remove