环境说明:
OS:windows 7 64bit Database:mysql-5.7.18-winx64 Noinstall版本
1. 解压Mysql安装目录
2. 编写my.ini配置文件
3. mysqld --defaults-file=../my.ini --initialize
4. ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
5. mysql –u root –p
6. 密码在logs/*.err日志中
my.ini文件内容
1 # my.ini文件内容
2 #
For advice
on how
to change settings please see
3 # http:
//dev.mysql.com
/doc
/refman
/5.7/en
/server
-configuration
-defaults.html
4 #
*** DO
NOT EDIT THIS
FILE. It
's a template which will be copied to the
5 # *** default location during install, and will be replaced if you
6 # *** upgrade to a newer version of MySQL.
7
8 [mysqld]
9
10 # Remove leading # and set to the amount of RAM for the most important data
11 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
12 # innodb_buffer_pool_size = 128M
13
14 # Remove leading # to turn on a very important data integrity option: logging
15 # changes to the binary log between backups.
16 # log_bin
17
18 # These are commonly set, remove the # and set as required.
19 basedir=D:\\mysql-5.7.18-winx64
20 datadir=D:\\mysql-5.7.18-winx64\\data
21 # port = ..
22 # server_id = ..
23
24
25 # Remove leading # to set options mainly useful for reporting servers.
26 # The server defaults are faster for transactions and fast SELECTs.
27 # Adjust sizes as needed, experiment to find the optimal values.
28 # join_buffer_size = 128M
29 # sort_buffer_size = 2M
30 # read_rnd_buffer_size = 2M
31
32 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
33
34 long_query_time=0.1
35 slow_query_log=on
36 slow_query_log_file=D:\\mysql-5.7.18-winx64\\logs\\mysqlslow.log
37