search
HomeDatabaseMysql Tutorialwin7配置免安装mysql5.6.19过程详解_MySQL

win7

本文主要介绍免安装配置mysql5.6.19的过程,整个过程中自己出现很多次失误,经过整理,现将一次可成功的过程记录下来,供大家参考。

准备

在mysq官网 http://dev.mysql.com/downloads/mysql/,下载最新稳定版本。

本文使用的mysql版本为5.6.19,因下载免安装版本,在页面选择“ Windows (x86, 64-bit), ZIP Archive ”【吐槽一下,越来越大了: 217.2M 】

解压

将下载的mysql.zip解压到E:/Develop/mysql-5.6.19-winx64

创建data目录

创建目录:E:/Develop/TestMysqlData,用于存放mysql的表和数据相关文件。

配置

拷贝mysql解压目录中my-default.ini为test.ini,将basedir、datadir配置为前面的mysql目录和data目录。

并增加编码配置:character_set_server=utf8、character_set_client=utf8

配置完后的文件如下:

basedir = E:/Develop/mysql-5.6.19-winx64datadir = E:/Develop/TestMysqlDatacharacter_set_server=utf8character_set_client=utf8
更多配置,可访问mysql官网的配置页面:http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html,

该地址在test.ini有。

注册服务

通过cmd进入mysq解压目录的bin目录中,执行如下命令:

mysqld install mysqltest --defaults-file="E:/Develop/mysql-5.6.19-winx64/test.ini"【注: mysqltest  为添加的服务名】

若出现如下信息,表明服务安装成功:

启动服务

通过cmd执行命令:

net start mysqltest 【注:此处必须与前面注册时,服务名一致】

按照本教程来执行的话,此时会报错,信息如下:

通过查看data目录,即E:/Develop/TestMysqlData目录下以.err结尾的日志文件,找到报错信息如下:

2014-06-29 15:58:07 9116 [Note] Plugin 'FEDERATED' is disabled.E:/Develop/mysql-5.6.19-winx64/bin/mysqld: Table 'mysql.plugin' doesn't exist2014-06-29 15:58:07 9116 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.2014-06-29 15:58:07 9116 [Note] InnoDB: Using atomics to ref count buffer pool pages
日志提示通过执行mysql_upgrade解决问题,继续在mysql解压目录的bin目录中执行:mysql_upgrade,出现如下异常信息:
E:/Develop/mysql-5.6.19-winx64/bin>mysql_upgradeLooking for 'mysql.exe' as: E:/Develop/mysql-5.6.19-winx64/bin/mysql.exeLooking for 'mysqlcheck.exe' as: E:/Develop/mysql-5.6.19-winx64/bin/mysqlcheck.exeFATAL ERROR: Upgrade failed

通过net start mysqltest启动服务,依然报错。

此时,将mysql解压目录中的data目录中所有文件拷贝到E:/Develop/TestMysqlData目录中,再启动服务则成功!

E:/Develop/mysql-5.6.19-winx64/bin>net start mysqltestmysqltest 服务正在启动 .mysqltest 服务已经启动成功。

连接数据库

通过workbench连接,打开后可以看到本地已经启动的mysql instance,双击即可直接打开连接。

创建数据库

通过在workbench的sql窗口执行如下脚步,即可创建默认编码为utf-8的数据库。

CREATE DATABASE test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
此时,数据库test的编码统一为utf8,工程编码再设置为utf8,基本会避免数据乱码的问题了。
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

How do you handle large datasets in MySQL?How do you handle large datasets in MySQL?Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you drop a table in MySQL using the DROP TABLE statement?How do you drop a table in MySQL using the DROP TABLE statement?Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you create indexes on JSON columns?How do you create indexes on JSON columns?Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do you represent relationships using foreign keys?How do you represent relationships using foreign keys?Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?Mar 18, 2025 pm 12:00 PM

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.