---
title: "Mysql安装配置"
author: "xiaohui1014"
date: "2012-03-15T09:15:42Z"
tags: ["MySQL"]
categories: ["行业应用"]
slug: "mysql"
draft: false
lastmod: "2012-03-15T09:15:42Z"
id: 1453785
url: "https://xiaohui1014.iteye.com/blog/1453785"
---

**Mysql安装配置**

**1.**       下载mysql5.5.18绿色版，mysql下载官网：mysql.com。

**2.**       解压到目录D:\\mysql5.5.18。

**3.**       将mysql添加到环境变量path：

;D:\\ mysql5.5.18\\bin

![](http://pic002.cnblogs.com/images/2011/358585/2011121012551934.png)

**4.**       修改端口和字符集：在安装目录下找到my.ini配置文件打开编辑，把端口改成3306（注：安装的时候默认就是3306），并且把服务器的字符集改成utf8(注：注意版本)，如下：

\# The following options will be passed to all MySQL clients

\[client]

#password   = your\_password

port               = 3306

socket           = /tmp/mysql.sock

default-character-set=gbk

 

\# Here follows entries for some specific programs

 

\# The MySQL server

\[mysqld]

port               = 3306

socket           = /tmp/mysql.sock

skip-locking

key\_buffer\_size = 256M

max\_allowed\_packet = 1M

table\_open\_cache = 256

sort\_buffer\_size = 1M

read\_buffer\_size = 1M

read\_rnd\_buffer\_size = 4M

myisam\_sort\_buffer\_size = 64M

thread\_cache\_size = 8

query\_cache\_size= 16M

\# Try number of CPU's\*2 for thread\_concurrency

thread\_concurrency = 8

default-character-set=utf8

log\_bin\_trust\_function\_creators = 1

**注意：my.ini配置文件一定要有。**

**5.**       mysql数据库安装好后，找到其安装目录下data文件夹，将数据库文件拷入data文件夹内。然后启动其安装目录下bin文件夹里面的mysqld。