Windows 下安装配置 MySQL 5.6.X

今天工作的电脑终于升级了 酷,硬件大大的好哇,有点小激动,哈哈

不过重新配置环境什么的就蛋疼了,哎 ~~~ 刚准备装MySQL, 就写写安装笔记吧~

 

 

1.  下载 MySQL 5.6.x:

     http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.15-winx64.zip

     http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.15-win32.zip

     PS: 本人下载的是64位版,请根据你的系统下载对应版本

 

2. 解压该文件到对应的目录

    PS:比如说 D:\dev_tools\mysql_5.6,安装路径最好没有空格或者中文或者横杆,不然有可能会出现无法

            安装服务的bug

 

3. 修改 mysql 目录下的文件名 my-default.ini  ==> my.ini

 

4.  打开 my.ini , 添加如下信息(最基本的配置)

[client]
default-character-set=utf8

[mysqld]
port=3306
basedir=D:\dev_tools\mysql_5.6
datadir=D:\dev_tools\mysql_5.6\data
default-storage-engine=INNODB
explicit_defaults_for_timestamp=true
character_set_server=utf8
collation-server=utf8_general_ci

    ==> 某些值请根据你的安装路径修改,我的默认编码是 UTF-8

 

5. 添加 mysql 环境变量到系统环境变量

    为了在任何位置打开命令行窗口都可以识别 mysql 相关命令,请依次添加

MYSQL_HOME  ==>  D:\dev_tools\mysql_5.6    (新建)

Path ==> ;%MYSQL_HOME%\bin;  (追加)

 

6. 验证

    打开命令行,输入 mysqld --console,就会看到如下类似的信息,mysql 服务启动成功

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Lstoryc>mysqld --console
2014-01-08 00:03:27 8160 [Note] Plugin 'FEDERATED' is disabled.
2014-01-08 00:03:27 8160 [Note] InnoDB: The InnoDB memory heap is disabled
2014-01-08 00:03:27 8160 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-01-08 00:03:27 8160 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-01-08 00:03:27 8160 [Note] InnoDB: Not using CPU crc32 instructions
2014-01-08 00:03:27 8160 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-01-08 00:03:27 8160 [Note] InnoDB: Completed initialization of buffer pool
2014-01-08 00:03:27 8160 [Note] InnoDB: Highest supported file format is Barracuda.
2014-01-08 00:03:28 8160 [Note] InnoDB: 128 rollback segment(s) are active.
2014-01-08 00:03:28 8160 [Note] InnoDB: Waiting for purge to start
2014-01-08 00:03:28 8160 [Note] InnoDB: 5.6.15 started; log sequence number 2669849
2014-01-08 00:03:28 8160 [Note] Server hostname (bind-address): '*'; port: 3306
2014-01-08 00:03:28 8160 [Note] IPv6 is available.
2014-01-08 00:03:28 8160 [Note]   - '::' resolves to '::';
2014-01-08 00:03:28 8160 [Note] Server socket created on IP: '::'.
2014-01-08 00:03:28 8160 [Note] Event Scheduler: Loaded 0 events
2014-01-08 00:03:28 8160 [Note] mysqld: ready for connections.
Version: '5.6.15'  socket: ''  port: 3306  MySQL Community Server (GPL)

 

7. 登陆 mysql 并设置 root 账号信息

    在启动 mysql 服务后,打开新的命令行窗口,输入如下内容

mysql -uroot 回车

use mysql;   

update user set password=PASSWORD("这里填写你要设置的密码") where user='root';

 

8.关闭服务,在开启 mysql 服务的命令行窗口下按 “Ctrl +  C” 即可

 

 

你可能感兴趣的:(windows)