基于Windows的MySQL、Redis环境安装与调试

本文详细介绍了在Windows上下载MySQL和Redis安装包,解压后配置my.ini文件,设置端口和字符集,调整环境变量,并通过命令行启动MySQL和Redis服务的过程。完成安装后,可以通过Java开发工具IDEA进行集成开发。
摘要由CSDN通过智能技术生成

一:MySQL、Redis官网download安装包

        古语有云:“物欲善其事,必先利其器”,选择firfox浏览器在地址栏输入官网域名地址前往MySQL官网(MySQL)下载安装包,同时前往redis官网(Redis)下载安装包。在完成以上步骤后对压缩包进行解压。

二:MySQL、Redis环境安装调试

        解压MySQL文件夹后,找到my.ini文件,my.ini文件可以配置客户端的通信端口port=3306,同时可以配置默认的字符集。配置文件见图1-1。

# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory 
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option 
# "--defaults-file". 
#
# To run run the server from the command line, execute this in a 
# command line shell, e.g.
# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# To install the server as a Windows service manually, execute this in a 
# command line shell, e.g.
# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guildlines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client ap
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
db服务器连接mysql+redis高可用高性能框架干货1、使用c++语言,vs2019开发垮平台[windows和linux]连接MySqlredis框架。2、使用MySql持久化玩家数据,redis做玩家数据缓存层,redis不做数据持久化。mysql搭配redis工作效率非常高效,就好比男女搭配干活不累,没有redismysql也能独立很好的完成用户读写请求。有了redis,用户访问数据的效率更高,时间更短,快速的完成请求。3、讲解如何保持mysqlredis数据强一致性策略,并在代码里实现。每次启动redis,使用管道技术,从mysql批量导入活跃用户数据到redis中,并设置过期时间.4、教程使用线程池技术,每个线程拥有自己独立的数据,线程绑定类。每一个实例就包含一个线程每个线程数据里包含:mysql连接器、redis连接器、内存回收池、安全的串行队列、条件变量、互斥量保证线程内的数据安全。5、工作原理:没有请求时,各个工作线程处于休眠状态。有读写请求时,从线程池获取一个线程,添加读写请求,把数据推送到线程工作队列中。然后工作线程获取队列的数据,进行串行工作任务安排,进行mysql数据库读写操作,以及redis读写数据操作,当完成工作任务时,执行下一个工作任务,同时把处理结果推送到逻辑线程,把数据给用户。6、用户读数据策略:用户获取数据首先是先从redis查找数据,redis命中,返回数据给玩家,redis命中失败,mysql中查找数据,然后写入数据到redis中,返回数据给用户。7、用户写数据策略:用户先从redis中删除数据,然后写数据到mysql中,最后再把数据写入到redis中,保持数据一致性。8、教程是一个干货教程,不是新手教程,mysql基础语法讲解的少,redis有讲解基础系列。教程讲解的是如何搭建一个支持高并发,高性能的读写数据库框架,使用mysql+redis搭配的高可用、高性能框架。该套框架在多个项目使用过,也在棋牌类项目里面使用过。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值