经常听说mysql数据库是集成在系统中,也一直不太明白集成的概念。今天才明白集成的概念就是将mysql所有的文件放到一个文件夹下放到系统中,也就是将mysql采用目录迁移部署的方式进行安装。在上一篇研究了mysql的数据存储结构之后,也研究了mysql作为目录部署以及安装为mysql服务的方法。

1.mysql目录安装

mysql目录安装也就是将mysql必须的一些文件放到一起,然后通过配置文件的配置即可实现。

mysql主要的目录也就是data目录以及bin(存mysql的可执行文件)、lib(存放mysql的dll库)、share(存放mysql的语言支持库)、uploads(一般作为mysql的导出目录)、my.ini(mysql的端口以及其他全局配置文件)。

例如我的目录安装的一个目录:

bin、lib、share、Uploads是直接从mysql5.7的安装目录下拷贝过来的,Data目录也是拷贝的,上篇文章已经讲解过Data目录下存放具体的Mysql的数据库以及表结构与表数据,查看Data的目录如下(是在原来的数据库迁移古来,所以如果集成部署成功数据库应该与原来一样):

my.ini文件:(注意标红位置的修改)

[client]

no-beep

port=3307[mysql]default-character-set=utf8

# server_type=3[mysqld]

# The TCP/IP Port the MySQL Server will listen on

port=3307# Path to installation directory. All paths are usually resolved relative tothis.

# basedir="C:/Program Files/MySQL/MySQL Server 5.7/"# Path to the database root

datadir=G:\mysql572\Data

# Thedefault character set that will be used when a new schema or table is# created and no characterset isdefined

character-set-server=utf8

# Thedefault storage engine that will be used when create newtables whendefault-storage-engine=INNODB

# Set the SQL mode to strict

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"# Enable Windows Authentication

# plugin-load=authentication_windows.dll

# General and Slow logging.

log-output=FILE

general-log=0general_log_file="MicroWin10-1535.log"slow-query-log=1slow_query_log_file="MicroWin10-1535-slow.log"long_query_time=10# Binary Logging.

log-error="MicroWin10-1535.err"# Server Id.

server-id=1# Secure File Priv.

secure-file-priv="G:\mysql572\Uploads"max_connections=151query_cache_size=0table_open_cache=2000tmp_table_size=34M

thread_cache_size=10myisam_max_sort_file_size=100G

myisam_sort_buffer_size=60M

key_buffer_size=8M

read_buffer_size=64K

read_rnd_buffer_size=256K

#*** INNODB Specific options ***# innodb_data_home_dir=0.0# Usethis option ifyou have a MySQL server with InnoDB support enabled

# but youdonot plan to use it. This will save memory and disk space

# and speed up some things.

# skip-innodb

# Ifset to 1, InnoDB will flush (fsync) the transaction logs to the

# disk at each commit, which offers full ACID behavior. If you are

# willing to compromisethissafety, and you are running small

# transactions, you mayset this to 0 or 2 to reduce disk I/O to the

# logs. Value0 means that the log isonly written to the log file and

# the log file flushed to disk approximately once per second. Value2# means the logiswritten to the log file at each commit, but the log

# fileisonly flushed to disk approximately once per second.

innodb_flush_log_at_trx_commit=1# The size of the buffer InnoDB usesfor buffering log data. As soon as# itis full, InnoDB will have to flush it to disk. As it isflushed

# once per second anyway, it does not make sense to have it very large

# (even withlongtransactions).

innodb_log_buffer_size=1M

# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and

# row data. The bigger youset this the less disk I/O isneeded to

# access datain tables. On a dedicated database server you may set this# parameter up to80% of the machine physical memory size. Do not setit

# too large, though, because competition of the physical memory may

# cause paginginthe operating system. Note that on 32bit systems you

# might be limited to2-3.5G of user level memory per process, so donot

#setit too high.

innodb_buffer_pool_size=8M

# Size of each log filein a log group. You should setthe combined size

# of log files to about25%-100%of your buffer pool size to avoid

# unneeded buffer pool flush activity on log file overwrite. However,

# note that a larger logfile size will increase the time neededforthe

# recovery process.

innodb_log_file_size=48M

# Number of threads allowed inside the InnoDB kernel. The optimal value

# depends highly on the application, hardwareas well asthe OS

# scheduler properties. A too high value may lead to thread thrashing.

innodb_thread_concurrency=9# The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full.

innodb_autoextend_increment=64# The number of regions that the InnoDB buffer poolisdivided into.

# For systems with buffer poolsin the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,

# by reducing contentionasdifferent threads read and write to cached pages.

innodb_buffer_pool_instances=8# Determines the number of threads that can enter InnoDB concurrently.

innodb_concurrency_tickets=5000# Specifies howlong inmilliseconds (ms) a block inserted into the old sublist must stay there after its first access before

# it can be moved to thenewsublist.

innodb_old_blocks_time=1000# It specifies the maximum number of .ibd files that MySQL can keep open at one time. The minimum valueis 10.

innodb_open_files=300# Whenthis variable isenabled, InnoDB updates statistics during metadata statements.

innodb_stats_on_metadata=0# When innodb_file_per_tableis enabled (the default in 5.6.6 and higher), InnoDB stores the data and indexes foreach newly created table

#in a separate .ibd file, rather than inthe system tablespace.

innodb_file_per_table=1innodb_checksum_algorithm=0back_log=80flush_time=0join_buffer_size=256K

max_allowed_packet=4M

max_connect_errors=100open_files_limit=4161query_cache_type=0sort_buffer_size=256K

table_definition_cache=1400binlog_row_event_max_size=8K

sync_master_info=10000sync_relay_log=10000sync_relay_log_info=10000

2.启动上面的mysql并且进行连接

G:\mysql572\bin>mysqld --defaults-file=G:\mysql572\my.ini

新开cmd窗口查看进程信息:

C:\Users\liqiang>tasklist |findstr mysql

mysqld.exe1912 Services 0 228,348K

mysqld.exe325752 Console 9 208,488K

mysql.exe325984 Console 9 5,328K

C:\Users\liqiang>netstat -ano | findstr 3307TCP0.0.0.0:3307 0.0.0.0:0 LISTENING 325752TCP [::]:3307 [::]:0 LISTENING 325752TCP [::1]:3307 [::1]:61234 ESTABLISHED 325752TCP [::1]:61234 [::1]:3307 ESTABLISHED 325984

连接上面启动的3307端口的mysql:

C:\Users\liqiang>mysql -uroot -p -P3307

Enter password:******Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connectionid is 2Server version:5.7.10-log MySQL Community Server (GPL)

Copyright (c)2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clearthe current input statement.

mysql> show variables like ‘log_error‘;+---------------+-----------------------+

| Variable_name | Value |

+---------------+-----------------------+

| log_error | .\MicroWin10-1535.err |

+---------------+-----------------------+

1 row in set, 1 warning (0.01sec)

mysql> show variables like ‘datadir‘;+---------------+-------------------+

| Variable_name | Value |

+---------------+-------------------+

| datadir | G:\mysql572\Data\ |

+---------------+-------------------+

1 row in set, 1 warning (0.00 sec)

3.将上面目录安装的mysql安装为windows服务

需以管理员身份执行cmd

C:\Windows\system32>G:\mysql572\bin\mysqld --install mysql572 --defaults-file="G:\mysql572\my.ini"Service successfully installed.

查看上面安装的服务:

C:\Windows\system32>sc qc mysql572

[SC] QueryServiceConfig 成功

SERVICE_NAME: mysql572

TYPE :10WIN32_OWN_PROCESS

START_TYPE :2AUTO_START

ERROR_CONTROL :1NORMAL

BINARY_PATH_NAME : G:\mysql572\bin\mysqld--defaults-file=G:\mysql572my.ini mysql572

LOAD_ORDER_GROUP :

TAG :0DISPLAY_NAME : mysql572

DEPENDENCIES :

SERVICE_START_NAME : LocalSystem

安装成功之后即可像正常的服务一样使用,启动可以用sc start mysql

删除服务也与平时删除服务一样:

sc delete mysql572

或者采用mysqld方式移除系统服务

mysqld--remove MySQL57

至此mysql集成安装完成,在实际的项目中我们可以采用这种方式将mysql嵌入到系统中进行部署安装。下面附一份实际项目中的my.ini的配置:

原文:https://www.cnblogs.com/qlqwjy/p/9484582.html

什么集成mysql_mysql集成部署相关推荐

  1. SpringBoot+Docker+Git+Jenkins实现简易的持续集成和持续部署

    前言 本篇文章引导你使用Jenkins部署[SpringBoot项目],同时使用Docker和Git实现简单的持续集成和持续部署.(项目地址:sso-merryyou) 流程图如下: push代码到G ...

  2. 半天搭建你的Jenkins持续集成与自动化部署系统

    前言 相信每一位程序员都经历过深夜加班上线的痛苦!而作为一个加班上线如家常便饭的码农,更是深感其痛.由于我们所做的系统业务复杂,系统庞大,设计到多个系统之间的合作,而核心系统更是采用分布式系统架构,由 ...

  3. 持续集成与持续部署实践_持续集成和部署的3个最佳实践

    持续集成与持续部署实践 本文涵盖了三个关键主题:自动化CI / CD配置,将Git存储库用于常见的CI / CD工件以及对Jenkins管道进行参数设置. 术语 首先是第一件事: 让我们定义一些术语. ...

  4. 持续集成与持续部署宝典Part 4:创建持续部署流水线

    2019独角兽企业重金招聘Python工程师标准>>> 随着Docker项目及其相关生态系统逐渐成熟,容器已经开始被更多企业用在了更大规模的项目中.因此,我们需要一套连贯的工作流程和 ...

  5. 持续集成与持续部署(五)01-TravisCI——使用简介-Travis CI 只支持 Github,提供的是持续集成服务 配置项目的.travis.yml文件

    持续集成与持续部署(五)01-TravisCI--使用简介-Travis CI 只支持 Github,提供的是持续集成服务 & 配置项目的.travis.yml文件 TravisCI 使用简介 ...

  6. 持续集成与持续部署(五)03-TravisCI——Travis CI和Docker的持续集成之所使用的基础组件、dockerfile配置、docker部署脚本

    持续集成与持续部署(五)03-TravisCI--Travis CI和Docker的持续集成之所使用的基础组件.dockerfile配置.docker部署脚本 所使用的基础组件 代码托管在Github ...

  7. Web系统版本更新与迭代方式——持续集成与持续部署(Python Django框架)

    一.持续集成与持续部署 在软件工程中,CI/CD是指持续集成和持续交付或者持续部署的组合. CI/CD通过构建应用程序.在测试和部署中实施自动化,从而在开发团队和运维团队之间架起一座桥梁,让项目能够更 ...

  8. .NET持续集成与自动化部署之路第三篇——测试环境到生产环境的一键部署策略(Windows)...

    Jenkins测试环境到生产环境的一键部署策略(Windows) 一.前言 前面我们已经初步实现了开发集成环境.测试环境的持续集成(自动化构建.自动化测试.自动化部署).但生产环境自动化部署迟迟没有推 ...

  9. 【Rhapsody学习笔记(二)】Linux环境下的Rhapsody集成引擎安装部署

    Rhapsody的安装部署包括Rhapsody引擎的部署(服务端),以及Rhapsody IDE(客户端)的安装部署,其中,IDE可以安装在多台不同的windows客户机上,本文仅介绍CentOS7环 ...

最新文章

  1. 在CISCO路由器上配置DHCP与DHCP中继
  2. NAT技术和代理服务器
  3. hashmap hashtable 的区别
  4. Vista光线效果photoshop教程
  5. html实体编码遇上js代码
  6. 微型计算机硬件中访问速度最快的,习题一计算机基础知识.doc.doc
  7. spring实战六之使用基于java配置的Spring
  8. java 抽象类,接口,object类详解
  9. FLV提取AAC音频单独播放并实现可视化的频谱
  10. java常用的统计_常用统计函数Java版[转]
  11. xxx is already defined as object xxx+intellij新建一个scala的maven项目+找不到或无法载入主要类别hello问题解决
  12. .Net应用之数据连接(少儿助学网MisDataSet.dll)原代码
  13. 未定义与 struct 类型的输入参数相对应的函数 fetch_引入鲁棒性作为连续参数,这种新损失函数实现了自适应、随时变换...
  14. mysql创建全外连接的视图_关系型数据库 MySQL 表索引和视图详解
  15. SpringMVC从入门到精通之第一章_慕课文章
  16. ZooKeeper动态重新配置
  17. CPU高速缓存SRAM命中问题的总结与实验
  18. 英伟达(NVIDIA)控制面板不见了
  19. 通过文献DOI下载外文文献
  20. python调用鼠标驱动_python_selenium_鼠标操作

热门文章

  1. Simulated Annealing(模拟退火算法)
  2. phpMyAdmin密码设置
  3. 太多的想法,反而不是什么好兆头
  4. 用iptables实现G1手机cmwap代理上http网站[转]
  5. [零基础学JAVA]Java SE应用部分-35.JAVA类集之四
  6. 重载与重写(overload and override)
  7. 简单绘图软件实现mfc大作业_纸笔书写|可直播可微课可写作业可批改的手写板,快来爱“我”吧...
  8. 前端之 JavaScript 常用数据类型和操作
  9. 单例设计模式-懒汉式(线程不安全)
  10. Django中的class Meta知识点