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,基本会避免数据乱码的问题了。

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

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]

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

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

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.

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.

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

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


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

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.