2、复制安装目录下my-default.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. [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 = D:\Program Files\MySQL\MySQL Server 5.6\ datadir = D:\Program Files\MySQL\MySQL Server 5.6\data\ port = 3306 server_id = 1 character_set_server=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
3、将安装路径"D:\Program Files\MySQL\MySQL Server 5.6\bin\"添加到系统环境变量。
4、以管理员身份运行CMD,并执行命令将MySQL安装为系统服务:
安装: mysqld install MySQL
移除: mysqld remove
5、启动MySQL服务
方法1:CMD下执行:net start MySQL
方法2:进入服务启动MySQL服务
6、修改root账号密码
D:\Program Files\MySQL\MySQL Server 5.6\bin> mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.05 sec)
mysql> use mysql;
Database changed
mysql> update user set password=PASSWORD('12345') where user='root';
Query OK, 3 rows affected (0.08 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye