[size=x-large]1、下载MySQL安装到指定目录下。[/size]
[size=x-large]2、复制安装目录下my-default.ini 为 my.ini,并修改相关信息[/size]
[size=x-large]3、将安装路径"D:\Program Files\MySQL\MySQL Server 5.6\bin\"添加到系统环境变量。[/size]
[size=x-large]4、以管理员身份运行CMD,并执行命令将MySQL安装为系统服务:[/size]
安装:[b]mysqld install MySQL[/b]
移除:[b]mysqld remove[/b]
[size=large]5、启动MySQL服务[/size]
方法1:CMD下执行:net start MySQL
方法2:进入服务启动MySQL服务
[size=x-large]6、修改root账号密码[/size]
D:\Program Files\MySQL\MySQL Server 5.6\bin>[b]mysql -uroot[/b]
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> [b]show databases;[/b]
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.05 sec)
mysql>[b] use mysql;[/b]
Database changed
mysql> [b]update user set password=PASSWORD('12345') where user='root';[/b]
Query OK, 3 rows affected (0.08 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql>[b] flush privileges;[/b]
Query OK, 0 rows affected (0.00 sec)
mysql>[b] quit[/b]
Bye
[size=x-large]2、复制安装目录下my-default.ini 为 my.ini,并修改相关信息[/size]
# 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
[size=x-large]3、将安装路径"D:\Program Files\MySQL\MySQL Server 5.6\bin\"添加到系统环境变量。[/size]
[size=x-large]4、以管理员身份运行CMD,并执行命令将MySQL安装为系统服务:[/size]
安装:[b]mysqld install MySQL[/b]
移除:[b]mysqld remove[/b]
[size=large]5、启动MySQL服务[/size]
方法1:CMD下执行:net start MySQL
方法2:进入服务启动MySQL服务
[size=x-large]6、修改root账号密码[/size]
D:\Program Files\MySQL\MySQL Server 5.6\bin>[b]mysql -uroot[/b]
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> [b]show databases;[/b]
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.05 sec)
mysql>[b] use mysql;[/b]
Database changed
mysql> [b]update user set password=PASSWORD('12345') where user='root';[/b]
Query OK, 3 rows affected (0.08 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql>[b] flush privileges;[/b]
Query OK, 0 rows affected (0.00 sec)
mysql>[b] quit[/b]
Bye