mysql 非安装版 zip_mysql.zip免安装版配置

1. 下载MySQL 选择自己想要的.本次安装.我使用的是mysql-5.6.17-winx64

地址:http://dev.mysql.com/downloads/mysql/

2. 解压zip 文件. 在mysql 的根目录下找到  my-default.ini  复制出一个 my.ini 文件, 根据你需要的位置修改 my.ini 文件

a)在[mysqld]下追加

-------

basedir = "d:\\mysql"

datadir = "d:\\mysql\\data"

character-set-server = utf8

-------

b) 在[client]下追加

-------

default-character-set = utf8

# 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 ifyou

#***upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAMforthe most important data

# cachein 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=.....

# datadir=.....

# port=.....

# server_id=.....

basedir=D:\work\mysql-5.6.17-winx64

datadir=F:\db-data\mysql

character-set-server =utf8

# Remove leading # to set options mainly usefulforreporting servers.

# The server defaults are fasterfortransactions and fast SELECTs.

# Adjust sizes as needed, experiment tofindthe optimal values.

# join_buffer_size=128M

# sort_buffer_size=2M

# read_rnd_buffer_size=2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[client]

default-character-set = utf8

3. 启动服务

保存

my.ini

的配置,然后打开命令行切换到mysql解压目录下的bin 目录;

执行 mysqld.exe console 命令测试一下

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe console2014-04-22 19:11:09 0[Warning] TIMESTAMP with implicit DEFAULT value is depreca

ted. Please use--explicit_defaults_for_timestamp server option (see documentati

onfor more details).

然后执行 mysqld.exe console 命令启动mysql

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe --console2014-04-22 19:11:33 0[Warning] TIMESTAMP with implicit DEFAULT value is depreca

ted. Please use--explicit_defaults_for_timestamp server option (see documentati

onfor moredetails).2014-04-22 19:11:33 5624 [Note] Plugin 'FEDERATED'is disabled.

mysqld.exe: Table'mysql.plugin' doesn't exist

2014-04-22 19:11:33 5624 [ERROR] Can't open the mysql.plugin table. Please run m

ysql_upgrade to create it.2014-04-22 19:11:33 5624[Note] InnoDB: Using atomics to ref count buffer pool p

ages2014-04-22 19:11:33 5624[Note] InnoDB: The InnoDB memory heap is disabled2014-04-22 19:11:33 5624[Note] InnoDB: Mutexes and rw_locks use Windows interlo

cked functions2014-04-22 19:11:33 5624 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-04-22 19:11:33 5624[Note] InnoDB: Not using CPU crc32 instructions2014-04-22 19:11:33 5624 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-04-22 19:11:33 5624[Note] InnoDB: Completed initialization of buffer pool2014-04-22 19:11:33 5624 [Note] InnoDB: Highest supported fileformat is Barracu

da.2014-04-22 19:11:33 5624 [Note] InnoDB: 128rollback segment(s) are active.2014-04-22 19:11:33 5624 [Note] InnoDB: Waiting forpurge to start2014-04-22 19:11:33 5624 [Note] InnoDB: 5.6.17 started; log sequence number 1600

607

2014-04-22 19:11:33 5624[Warning] No existing UUID has been found, so we assume

that this is the firsttimethat this server has been started. Generating a new

UUID: dcd35109-ca0e-11e3-a872-003018a05bef.2014-04-22 19:11:33 5624 [Note] Server hostname (bind-address): '*'; port: 3306

2014-04-22 19:11:33 5624[Note] IPv6 is available.2014-04-22 19:11:33 5624 [Note] - '::' resolves to '::';2014-04-22 19:11:33 5624 [Note] Server socket created on IP: '::'.2014-04-22 19:11:33 5624 [ERROR] Fatal error: Can't open and lock privilege tabl

es: Table 'mysql.user' doesn't exist

注:这里出现异常 :Table 'mysql.user' doesn't exist 是因为我没有吧数据文件复制到 my.ini 里面配置的路径下,

数据文件是在 mysql 解压目录的下 的 data 目录, 吧整个目录里的内容复制到配置文件里写的目录里,然后启动

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe --console2014-04-22 19:16:31 0[Warning] TIMESTAMP with implicit DEFAULT value is depreca

ted. Please use--explicit_defaults_for_timestamp server option (see documentati

onfor moredetails).2014-04-22 19:16:31 6180 [Note] Plugin 'FEDERATED'is disabled.2014-04-22 19:16:31 6180[Note] InnoDB: Using atomics to ref count buffer pool p

ages2014-04-22 19:16:31 6180[Note] InnoDB: The InnoDB memory heap is disabled2014-04-22 19:16:31 6180[Note] InnoDB: Mutexes and rw_locks use Windows interlo

cked functions2014-04-22 19:16:31 6180 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-04-22 19:16:31 6180[Note] InnoDB: Not using CPU crc32 instructions2014-04-22 19:16:31 6180 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-04-22 19:16:31 6180[Note] InnoDB: Completed initialization of buffer pool2014-04-22 19:16:32 6180 [Note] InnoDB: Highest supported fileformat is Barracu

da.2014-04-22 19:16:32 6180 [Note] InnoDB: 128rollback segment(s) are active.2014-04-22 19:16:32 6180 [Note] InnoDB: Waiting forpurge to start2014-04-22 19:16:32 6180 [Note] InnoDB: 5.6.17 started; log sequence number 1625

987

2014-04-22 19:16:32 6180[Warning] No existing UUID has been found, so we assume

that this is the firsttimethat this server has been started. Generating a new

UUID: 8f19129f-ca0f-11e3-a876-003018a05bef.2014-04-22 19:16:32 6180 [Note] Server hostname (bind-address): '*'; port: 3306

2014-04-22 19:16:32 6180[Note] IPv6 is available.2014-04-22 19:16:32 6180 [Note] - '::' resolves to '::';2014-04-22 19:16:32 6180 [Note] Server socket created on IP: '::'.2014-04-22 19:16:32 6180 [Note] Event Scheduler: Loaded 0events2014-04-22 19:16:32 6180 [Note] mysqld.exe: ready forconnections.

Version:'5.6.17' socket: '' port: 3306 MySQL Community Server (GPL)

证明mysql服务已启动

6. 设置登陆mysql root帐号的的密码

在mysql/bin 目录下打开新的命令行,输入mysql 回车

D:\work\mysql-5.6.17-winx64\bin>mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connectionid is 1Server version:5.6.17MySQL 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 clearthe current input statement.

mysql>

看到上面类似内容说明登陆成功,此时的root帐号是没有密码的,而我也没打算要密码

想要设置可使用命令

直接运行命令行窗口输入下面的

mysqladmin -u root password

你的密码

这样就Ok了,

7. 安装mysql服务

在bin目录下执行命令

mysqld.exe --install MySQL5.6.17 --defaults-file="D:\work\mysql-5.6.17-winx64\my.ini"

结果如下.

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe --install MySQL5.6.17 --defaults-file

="D:\work\mysql-5.6.17-winx64\my.ini"Service successfully installed.

8.启动服务

net start MySQL5.6.17

D:\work\mysql-5.6.17-winx64\bin>net start MySQL5.6.17MySQL5.6.17服务正在启动 .

MySQL5.6.17 服务已经启动成功。

注:若启动不成功修改注册表开始->运行->regedit

找HKEY_LOCAL_MECHINE---SYSTEM ---ControlSet001或ControlSet002中找Services,

再找MySQL项,修改 ImagePath值改为:"D:\work\mysql-5.6.17-winx64\bin\mysqld" --defaults-file="D:\work\mysql-5.6.17-winx64\my.ini" MySQL

最后为了方便添加环境变量.

MYSQL=D:\work\mysql-5.6.17-winx64

Path=%MYSQL%/bin;Path...

测试:

C:\Windows\System32>SET PATH=%MYSQL%\bin;%PATH%C:\Windows\System32>echoPATH

PATH

C:\Windows\System32>echo %PATH%D:\work\mysql-5.6.17-winx64\bin;D:\Program Files\java\jdk1.7.0_15\bin;D:\Program

Files\java\jdk1.7.0_15\jre\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\

C:\Windows\System32>mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connectionid is 2Server version:5.6.17MySQL 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 clearthe current input statement.

mysql>

到此结束.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值