mysql绿色版安装

来源:互联网 发布:手机数据恢复精灵 编辑:程序博客网 时间:2024/06/01 09:25

下载mysql地址

http://dev.mysql.com/downloads/mysql/
下载需要一个oracle账号。具体如下:
这里写图片描述

数据库安装

解压下载的zip文件,在解压的目录下,复制一份my-default.ini文件重命名为my.ini。
修改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.#mysql的根目录basedir ="D:\application\mysql-5.7.16-winx64"#mysql的数据存储目录datadir ="D:\application\mysql-5.7.16-winx64\data"#使用默认的# port = .....#使用默认的# server_id = .....# 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 ##服务端的编码方式character-set-server=utf8[client]loose-default-character-set =utf8[WinMySQLadmin]Server = "D:\application\mysql-5.7.16-winx64\bin\mysqld.exe"

注册mysql服务

开始——运行——cmd,然后cd到mysql安装目录的bin下面,我的目录就是“D:\application\mysql-5.7.16-winx64\bin”,然后执行mysqld -install,提示服务安装成功!运行services.msc一看,确实有一个名为MySQL的服务了。

初始化mysql

进入mysql的bin目录下执行,会生成一个临时密码

mysqld --initialize --user=mysql --console

执行方式和执行结果如下:
这里写图片描述

启动mysql服务并修改密码

运行services.msc。找到mysql服务。
连接mysql的,并修改密码:
这里写图片描述
退出再次输入上次修改的密码登录。
至此,mysql安装成功!

1 0
原创粉丝点击