windows上同时安装两个不同版本的mysql

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: windows上同时安装两个不同版本的mysql

之前安装过一个Mysql5.7版本的,由于项目中使用的是老版本的所以又装了一个5.5的,不同版本的区别还是挺大的。


1.免安装mysql下载地址,msi后缀的是安装包根据引导安装就好,zip的是免安装的需要配置环境变量


https://dev.mysql.com/downloads/mysql/5.5.html#downloads


2.解压到一个位置,复制my-small.ini文件改名为my.ini,初始化服务的时候会重这里面加载配置文件。


比较重要的几个地方就是要修改端口号,因为之前3306已经被用过了,所以我把它改成了3307,还有两个字符设置为utf-8,


还有两个目录根据自己的软件的位置进行配置。一些其他的参数也可以在这里面改。

# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
default-character-set=utf8
#password = your_password
port    = 3307
socket    = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
basedir = D:/software/mysql-5.5.62-winx64
datadir = D:/software/mysql-5.5.62-winx64/data
character-set-server = utf8
port    = 3307
socket    = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
# 
#skip-networking
server-id = 1
# Uncomment the following if you want to log updates
#log-bin=mysql-bin
# binary logging format - mixed recommended
#binlog_format=mixed
# Causes updates to non-transactional engines using statement format to be
# written directly to binary log. Before using this option make sure that
# there are no dependencies between transactional and non-transactional
# tables such as in the statement INSERT INTO t_myisam SELECT * FROM
# t_innodb; otherwise, slaves may diverge from the master.
#binlog_direct_non_transactional_updates=TRUE
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = C:\\mysql\\data\\
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:\\mysql\\data\\
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout

3.环境变量配置

D:\software\mysql-5.5.62-winx64\bin添加到环境变量

20181208154257488.png

如果你原来的mysql配置了环境变量,需要先去除mysql的环境变量(这个会影响数据库的服务注册,版本就还是会之前的那个),安装完成之后再添加回去。

4.添加服务

cmd进入到bin目录下

20181208154427699.png

20181208154559966 (1).png

这样我们就安装好了,可以在服务里面同时打开两个不同的版本。

20181208154700391.png

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
11天前
|
存储 Ubuntu 关系型数据库
Ubuntu 20.04 卸载与安装 MySQL 5.7 详细教程
该文档提供了在Ubuntu上卸载和安装MySQL 5.7的步骤。首先,通过`apt`命令卸载所有MySQL相关软件包及配置。然后,下载特定版本(5.7.32)的MySQL安装包,解压并安装所需依赖。接着,按照特定顺序安装解压后的deb包,并在安装过程中设置root用户的密码。安装完成后,启动MySQL服务,连接数据库并验证。最后,提到了开启GTID和二进制日志的配置方法。
|
1天前
|
关系型数据库 应用服务中间件 nginx
docker基础,docker安装mysql,docker安装Nginx,docker安装mq,docker基础命令
docker基础,docker安装mysql,docker安装Nginx,docker安装mq,docker基础命令
|
1天前
|
SQL 关系型数据库 数据库
nacos 2.2.3版本 查看配置文件的历史版本的接口 是针对MySQL数据库的sql 改成postgresql后 sql语句报错 该怎么解决
在Nacos 2.2.3中切换到PostgreSQL后,执行配置文件历史版本分页查询出错,因`LIMIT 0, 10`语法不被PostgreSQL支持,需改为`LIMIT 10 OFFSET 0`。仅当存在历史版本时报错。解决方案是调整查询SQL以兼容PostgreSQL语法。
|
2天前
|
Apache Windows
windows 一键安装apache服务器 windows傻瓜式安装apache2 web服务器管理软件
windows 一键安装apache服务器 windows傻瓜式安装apache2 web服务器管理软件
|
2天前
|
Apache Windows
windows源码安装apache2 win安装apache 阿帕奇服务器
windows源码安装apache2 win安装apache 阿帕奇服务器
|
2天前
|
Windows
win10家庭版安装iis 微软web服务器 windows安装IIS web服务器
win10家庭版安装iis 微软web服务器 windows安装IIS web服务器
|
2天前
|
关系型数据库 MySQL Linux
centos linux mysql 5.5脚本全自动源码包 编译安装
centos linux mysql 5.5脚本全自动源码包 编译安装
|
3天前
|
Oracle Java 关系型数据库
02. 【Java教程】Windows 上安装 Java
02. 【Java教程】Windows 上安装 Java
6 1
|
6天前
|
Windows
Windows 系统下安装
**安装Windows上的Julia:** 访问[julialang.org/downloads](https://julialang.org/downloads/)下载安装程序。32位版兼容32/64位系统,但64位版仅适用于64位Windows。安装时,选择&quot;Add Julia To PATH&quot;以添加到环境变量,简化后续命令行使用。默认路径如C:\Users\BAIDU\AppData\Local\Programs\Julia 1.7.2。只需简单下一步安装。
|
10天前
|
Windows
如何使用GUID硬盘分区格式安装新windows系统
这篇文章介绍了全局唯一标识分区表(GUID Partition Table, GPT)与主引导记录(Master Boot Record, MBR)两种硬盘分区格式的区别。
19 0