windows下安装多个mysql5.7.16免安装版版本数据库

一:安装mysql5.7.16 1)解压mysql-5.7.16-winx64到指定文件夹下 ,路径为:E:\jee\mysql-5.7.16-winx64 2)拷贝my-default.ini,改名为my.ini 3)创建数据文件夹data到指定目录(一般情况下选择在mysql5.7.16文件夹下创建data文件夹) 4)在my.ini文件夹中添加mysql文件夹目录,数据文件目录,指定端口等。修改后全文件内容如下:

# 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 = .....
# 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
# 以下内容手动添加
[client]
port=3306
default-character-set=utf8
[mysqld]
port=3306
character_set_server=utf8
#解压目录
basedir=E:\jee\mysql-5.7.16-winx64
#解压目录下data目录
datadir=E:\jee\mysql-5.7.16-winx64\data
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[WinMySQLAdmin]
E:\jee\mysql-5.7.16-winx64\bin\mysqld.exe

5)在环境变量中添加mysql启动路径:E:\jee\mysql-5.7.16-winx64\bin 6)右键cmd.exe,选择以管理员身份运行cmd.exe 7) 在dos窗口中执行如下命令,将mysql添加到windows服务中,方便日后手动启动、停止mysql。 mysqld --install MYSQL 8)在dos窗口中执行如下命令,创建数据库文件 mysqld --initialize-insecure --user=mysql 9)启动数据库,执行如下命令 net start mysql 10)关闭数据库,执行如下命令 net stop mysql 11)移除服务名,执行如下命令 mysqld --remove mysql

二、安装第二个myql数据库 1)拷贝源数据库文件夹,并更名,如:mysql5.7.15。路径为E:\jee\mysql-5.7.15-winx64 2)手动清空data目录,重新创建数据库(不执行此步骤,会造成数据库无法安装,启动等问题) 3)修改my.ini文件中mysql文件夹目录,数据文件目录,指定端口等。修改后全文件内容如下:# 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 = .....

# 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

# 以下内容手动添加

[client]

port=3307

default-character-set=utf8

[mysqld]

port=3307

character_set_server=utf8

#解压目录

basedir=E:\jee\mysql-5.7.15-winx64

#解压目录下data目录

datadir=E:\jee\mysql-5.7.15-winx64\data

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[WinMySQLAdmin]

E:\jee\mysql-5.7.15-winx64\bin\mysqld.exe

4)在环境变量中添加mysql启动路径:E:\jee\mysql-5.7.15-winx64\bin 5)右键cmd.exe,选择以管理员身份运行cmd.exe 6) 在dos窗口中执行如下命令,将mysql添加到windows服务中,方便日后手动启动、停止mysql。 mysqld --install MYSQL2 --defaults-file="E:\jee\mysql-5.7.15-winx64\bin\my.ini" 备注:此时需要添加--defaults-file参数,否则由于环境变量问题启动报错 7)打开注册表,找到HKEY_LOCAL_MACHINE\SYSTEM\services\MYSQL2,修改ImagePath参数,更正mysql服务相关路径。修改后内容如下: E:\jee\mysql-5.7.15-winx64\bin\mysqld --defaults-file=E:\jee\mysql-5.7.15-winx64\\my.ini MySQL2 8)在dos窗口,进入到bin目(即:E:\jee\mysql-5.7.15-winx64\bin)录后,执行如下命令,创建数据库文件 mysqld --initialize-insecure --user=mysql 9)启动数据库,执行如下命令 net start mysql2 10)关闭数据库,执行如下命令 net stop mysql 2 11)移除服务名,执行如下命令 mysqld --remove mysql2

本文数据库(mysql)相关术语:navicat for mysql mysql workbench mysql数据库 mysql 存储过程 mysql安装图解 mysql教程 mysql 管理工具

分页:12
转载请注明
本文标题:windows下安装多个mysql5.7.16免安装版版本数据库 Windows Windows系统 mysql mysql安 ...
本站链接:http://www.codesec.net/view/520572.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mysql) | 评论(0) | 阅读(93)