Home  >  Article  >  Database  >  配置免安装版的mysql_MySQL

配置免安装版的mysql_MySQL

WBOY
WBOYOriginal
2016-06-01 11:52:331057browse

 

 

1.下载免安装版的压缩文件之后,解压至一个目录,如:D:\mysql\mysql56

2.在解压后的根目录下有一个my-default.int,复制此文件至别的目录,重命名为my.ini。

2.1. 修改my.ini文件,具体内容如下所示:

 

[client]
    port=3306
    default-character-set=utf8

[mysqld]
# These are commonly set, remove the # and set as required.
 basedir = D:\mysql\mysql56
 datadir = D:\mysql\mysql56\data
 port = 3306
 character_set_server=utf8

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

[WinMySQLAdmin]
Server=D:\mysql\mysql56\bin\mysqld.exe

 

2.2.将此my.ini剪切后粘贴至mysql解压后的根目录下。

3. 配置环境变量:

3.1 MYSQL_HOME=D:\mysql\mysql56(解压缩后的根目录)

3.2 Path 后追加 ;%MYSQL_HOME%\bin

4. 从控制台cd到 mysql解压后的bin目录下后,把mysql安装成系统服务。

如4.1: C:\Users\Administrator>D:

4.2: D>D:\mysql\mysql56\bin

4.3: mysqld install MySQL --defaults-file="D:\Program Files\MySQL\mysql-5.6.13-win32\my.ini"

5. 启动mysql服务:net start mysql.

6. 修改mysql数据库服务器用户名:root 的密码

c:>mysql –uroot
mysql>use mysql;
mysql>UPDATE user SET password=PASSWORD("ganbare") WHERE user='root';
mysql>FLUSH PRIVILEGES;
mysql>QUIT


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