MYSQL5.6.X 非在线安装版(解压版)安装过程

一、卸载以前旧版本(本人5.5版本)

1、关闭MySQL服务

以管理员身份运行cmd,执行以下命令: 
net stop mysql

或者右键我的电脑,在管理——服务——停止MySQL

2、卸载MySQL应用

mysqld -remove [服务名]
服务名称可以在右键我的电脑,在管理——服务——右键点击MySQL查看属性找到:如下图

3、删除MySQL文件
下面的将本地MySQL文件删除掉,路径可通过上图服务名称下面的可执行文件的路径查到。

4、删除注册表信息

开始->运行-> regedit 看看注册表里这几个地方删除没有   

HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesEventlogApplicationMySQL 目录删除   HKEY_LOCAL_MACHINESYSTEMControlSet002ServicesEventlogApplicationMySQL 目录删除   HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventlogApplicationMySQL 目录删除

注册表中的ControlSet001、ControlSet002不一定是001和002,可能是ControlSet005、006之类,删除的时候都删除就可以 。

完成以上四步即可成功卸载MySQL解压版环境。

二、安装MySQL5.6解压版

1.下载MYSQL的安装包

可以去官网下载ZIP包,http://www.mysql.com/downloads/mysql/点击打开链接

我安装的是mysql-5.6.35-winx64


2.解压到本地目录

E:mysql-5.6.35-winx64


3.添加系统环境变量

添加系统环境变量是为了在命令控制窗口里更方便点。


新建:MYSQL_HOME ==> E:mysql-5.6.35-winx64
追加:PATH==> ;%MYSQL_HOME%in


4. 修改mysql-5.6.35-winx64的配置文件:my-default.ini
在[mysqld]下追加
-------
basedir=E:mysql-5.6.35-winx64
datadir=E:mysql-5.6.35-winx64data
character-set-server = utf8
-------

5.安装MySQL5.6应用


保存my-default.ini的配置,

然后打开命令行(开始菜单==>运行==>cmd )
输入: mysqld --console 然后回车将看到如下类似内容:
-------
C:Windowssystem32>mysqld --console
120410 14:25:22 [Note] Plugin 'FEDERATED' is disabled.
120410 14:25:22 InnoDB: The InnoDB memory heap is disabled
120410 14:25:22 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120410 14:25:22 InnoDB: Compressed tables use zlib 1.2.3
120410 14:25:22 InnoDB: Initializing buffer pool, size = 128.0M
120410 14:25:22 InnoDB: Completed initialization of buffer pool
120410 14:25:22 InnoDB: highest supported file format is Barracuda.
120410 14:25:22 InnoDB: Waiting for the background threads to start
120410 14:25:23 InnoDB: 1.1.8 started; log sequence number 1595675
120410 14:25:23 [Note] Event Scheduler: Loaded 0 events
120410 14:25:23 [Note] mysqld: ready for connections.
Version: '5.5.22' socket: '' port: 3306 MySQL Community Server (GPL)
-------
==> 证明mysql服务已启动


6. 设置登陆mysql root帐号的的密码
打开新的命令行,输入 mysql -uroot 回车
-------
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.5.22 MySQL Community Server (GPL)


Copyright (c) 2000, 2011, 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. www.2cto.com 


Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
-------
==〉看到上面类似内容说明登陆成功,此时的root帐号是没有密码的
执行命令修改密码:


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


执行完成后退出mysql操作,然后关闭mysql服务,然后重启mysql服务


然后使用你的root帐号登录 

mysqladmin -u root password 你的密码


这样就可以正常登录了。

原文地址

http://blog.csdn.net/y562363753/article/details/68065086