Table of Contents
准备
解压
创建data目录
配置
注册服务
启动服务
连接数据库
创建数据库
Home Database Mysql Tutorial win7配置免安装mysql5.6.19过程详解_MySQL

win7配置免安装mysql5.6.19过程详解_MySQL

May 31, 2016 am 08:50 AM

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
Copy after login
更多配置,可访问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
Copy after login
日志提示通过执行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
Copy after login

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

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

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

连接数据库

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

创建数据库

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

CREATE DATABASE test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Copy after login
此时,数据库test的编码统一为utf8,工程编码再设置为utf8,基本会避免数据乱码的问题了。
Statement of this Website
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

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 Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

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.

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

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 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.

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.

See all articles