windows mysql绿色版配置Mysql5.7.X

MySQL绿色版安装,很简单按照下面的方式很快就可以实现了。

1.下载地址

https://dev.mysql.com/downloads/mysql/   

百度网盘链接:https://pan.baidu.com/s/1ieuZsB095CnH61cEBa6Hxg 提取码:1k08

2.配置my.ini 文件

解压下载文件到指定目录。如:      

windows mysql绿色版配置Mysql5.7.X_第1张图片

my.ini文件内容:

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
basedir=D:\DEVELOPERS\mysql-5.7.9-winx64
datadir=D:\DEVELOPERS\mysql-5.7.9-winx64\data
port=3306
max_connections=500
character-set-server=utf8
default-storage-engine=INNODB
server_id=1

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

 

3.执行安装mysql   

cmd命令令行进入文件目录: 

 

 

执行mysqld install 命令,出现如下提示,安装成功。 

windows mysql绿色版配置Mysql5.7.X_第2张图片

 

 Service sucessfully installed.

注: 如出现 Install/Remove of the Service Denied 请使用管理员启动命令行。

4.初始化数据库   

执行 mysqld --initialize   命令没有输出提示。

windows mysql绿色版配置Mysql5.7.X_第3张图片

root 密码初始化在data文件夹 *.err 文件中:   

windows mysql绿色版配置Mysql5.7.X_第4张图片

 

 

5.启动mysql服务   

执行 net start mysql   

windows mysql绿色版配置Mysql5.7.X_第5张图片

 

 

 

注:启动mysql服务可以在任意路径下,必须以管理员方式运行的命令行。

 

6.进入mysql 

执行 mysql -u root -p #注:这个命令只能在mysql的bin文件路径下执行。   

windows mysql绿色版配置Mysql5.7.X_第6张图片

 

 

输入密码,进入系统。   

7.修改root密码 

执行 set password for root@localhost = password('123456');   

windows mysql绿色版配置Mysql5.7.X_第7张图片

8.添加环境变量(可选)   

windows mysql绿色版配置Mysql5.7.X_第8张图片

 进入数据库查看数据库实例:

windows mysql绿色版配置Mysql5.7.X_第9张图片

 

 

 参考文章:https://www.cnblogs.com/Springmoon-venn/p/6849715.html

你可能感兴趣的:(windows mysql绿色版配置Mysql5.7.X)