d:/software/mysql-advanced-5.6.18-winx64
my-default.ini 改名my.ini
my.ini内容如下
# for advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html# *** do not edit this file. it's a template which will be copied to the# *** default location during install, and will be replaced if you# *** upgrade to a newer version of mysql.[client]default-character-set=utf8[mysqld]character_set_server=utf8# 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 = d:/software/mysql-advanced-5.6.18-winx64datadir = d:/software/mysql-advanced-5.6.18-winx64/data# port = .....# server_id = .....# 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
打开 windows 环境变量设置, 新建变量名 mysql_home , 变量值为 mysql 安装目录路径, 这里为 d:/software/mysql-advanced-5.6.18-winx64
在 环境变量 的 path 变量中添加 ;%mysql_home%/bin;
安装 mysql 服务, 打开windows命令提示符, 执行命令: mysqld --install mysql --defaults-file=d:/software/mysql-advanced-5.6.18-winx64/my.ini
启动: net start mysql
停止: net stop mysql
卸载: sc delete mysql
修改密码:
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.32-community mysql community edition (gpl)
type 'help;' or '/h' for help. type '/c' to clear the buffer.
mysql>use mysql
mysql> update user set password=password(’新密码’) where user=’root’;
mysql> flush privileges;
mysql>quit;
