目录
MYSQL ZIP免安装版配置
首页 数据库 mysql教程 mysql.zip免安装版配置_MySQL

mysql.zip免安装版配置_MySQL

Jun 01, 2016 pm 01:11 PM

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 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 = .....# datadir = .....# port = .....# server_id = ..... basedir =D:/work/mysql-5.6.17-winx64datadir =F:/db-data/mysqlcharacter-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 [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 deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for 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 deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2014-04-22 19:11:33 5624 [Note] Plugin 'FEDERATED' is disabled.mysqld.exe: Table 'mysql.plugin' doesn't exist2014-04-22 19:11:33 5624 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.2014-04-22 19:11:33 5624 [Note] InnoDB: Using atomics to ref count buffer pool pages2014-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 interlocked functions2014-04-22 19:11:33 5624 [Note] InnoDB: Compressed tables use zlib 1.2.32014-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.0M2014-04-22 19:11:33 5624 [Note] InnoDB: Completed initialization of buffer pool2014-04-22 19:11:33 5624 [Note] InnoDB: Highest supported file format is Barracuda.2014-04-22 19:11:33 5624 [Note] InnoDB: 128 rollback segment(s) are active.2014-04-22 19:11:33 5624 [Note] InnoDB: Waiting for purge to start2014-04-22 19:11:33 5624 [Note] InnoDB: 5.6.17 started; log sequence number 16006072014-04-22 19:11:33 5624 [Warning] No existing UUID has been found, so we assume that this is the first time that 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: 33062014-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 tables: Table 'mysql.user' doesn't exist<br>
登录后复制

注:这里出现异常 :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 deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).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 pages2014-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 interlocked functions2014-04-22 19:16:31 6180 [Note] InnoDB: Compressed tables use zlib 1.2.32014-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.0M2014-04-22 19:16:31 6180 [Note] InnoDB: Completed initialization of buffer pool2014-04-22 19:16:32 6180 [Note] InnoDB: Highest supported file format is Barracuda.2014-04-22 19:16:32 6180 [Note] InnoDB: 128 rollback segment(s) are active.2014-04-22 19:16:32 6180 [Note] InnoDB: Waiting for purge to start2014-04-22 19:16:32 6180 [Note] InnoDB: 5.6.17 started; log sequence number 16259872014-04-22 19:16:32 6180 [Warning] No existing UUID has been found, so we assume that this is the first time that 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: 33062014-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 0 events2014-04-22 19:16:32 6180 [Note] mysqld.exe: ready for connections.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>mysqlWelcome to the MySQL monitor.  Commands end with ; or /g.Your MySQL connection id is 1Server 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 itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the 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>echo PATHPATHC:/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>mysqlWelcome to the MySQL monitor.  Commands end with ; or /g.Your MySQL connection id is 2Server 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 itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql>
登录后复制

 

到此结束.

 

 

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

减少在Docker中使用MySQL内存的使用 减少在Docker中使用MySQL内存的使用 Mar 04, 2025 pm 03:52 PM

本文探讨了Docker中的优化MySQL内存使用量。 它讨论了监视技术(Docker统计,性能架构,外部工具)和配置策略。 其中包括Docker内存限制,交换和cgroups

mysql无法打开共享库怎么解决 mysql无法打开共享库怎么解决 Mar 04, 2025 pm 04:01 PM

本文介绍了MySQL的“无法打开共享库”错误。 该问题源于MySQL无法找到必要的共享库(.SO/.DLL文件)。解决方案涉及通过系统软件包M验证库安装

如何使用Alter Table语句在MySQL中更改表? 如何使用Alter Table语句在MySQL中更改表? Mar 19, 2025 pm 03:51 PM

本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

在 Linux 中运行 MySQl(有/没有带有 phpmyadmin 的 podman 容器) 在 Linux 中运行 MySQl(有/没有带有 phpmyadmin 的 podman 容器) Mar 04, 2025 pm 03:54 PM

本文比较使用/不使用PhpMyAdmin的Podman容器直接在Linux上安装MySQL。 它详细介绍了每种方法的安装步骤,强调了Podman在孤立,可移植性和可重复性方面的优势,还

什么是 SQLite?全面概述 什么是 SQLite?全面概述 Mar 04, 2025 pm 03:55 PM

本文提供了SQLite的全面概述,SQLite是一个独立的,无服务器的关系数据库。 它详细介绍了SQLite的优势(简单,可移植性,易用性)和缺点(并发限制,可伸缩性挑战)。 c

在MacOS上运行多个MySQL版本:逐步指南 在MacOS上运行多个MySQL版本:逐步指南 Mar 04, 2025 pm 03:49 PM

本指南展示了使用自制在MacOS上安装和管理多个MySQL版本。 它强调使用自制装置隔离安装,以防止冲突。 本文详细详细介绍了安装,起始/停止服务和最佳PRA

如何为MySQL连接配置SSL/TLS加密? 如何为MySQL连接配置SSL/TLS加密? Mar 18, 2025 pm 12:01 PM

文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么? 哪些流行的MySQL GUI工具(例如MySQL Workbench,PhpMyAdmin)是什么? Mar 21, 2025 pm 06:28 PM

文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]

See all articles