【DM】达梦数据库与MySQL适配

达梦数据库介绍 阅读详情
AI摘要

文章介绍了达梦数据库的特点和与MySQL在SQL语法上的区别,包括COMMENTON、date_sub、date_format等函数的替代用法,并提供了JAVA项目连接DM数据库的步骤和MySQL转达梦SQL的注意事项,涉及数据迁移、权限验证、模式指定等问题。

一、达梦入门技术文档

新手直接看达梦入门技术文档即可

在这里插入图片描述

二、达梦数据库

1、介绍

达梦数据库管理系统是达梦公司推出的具有完全自主知识产权的高性能数据库管理系统,简称DM,它具有如下特点:通用性、高性能、高可用、跨平台、高可扩展

2、与MySQL的区别

(1)创建表的时候,不支持在列的后面直接加comment注释,使用 COMMENT ON IS 代替,如:

   COMMENT ON TABLE xxx IS xxx
   COMMENT ON COLUMN xxx IS xxx

(2)不支持 date_sub 函数,使用 dateadd(datepart,n,date) 代替,其中,datepart可以为:year(yy,yyyy),quarter(qq,q),month(mm,m),dayofyear(dy,y),day(dd,d),week(wk,ww),weekday(dw),hour(hh), minute(mi,n), second(ss,s), millisecond(ms),例子:

select dateadd(month, -6, now());
select dateadd(month, 2, now());

(3)不支持 date_format 函数,它有三种代替方法:

A: 使用 datepart 代替:语法:datepart(datepart, date),返回代表日期的指定部分的整数,datepart可以为:year(yy,yyyy),quarter(qq,q),month(mm,m),dayofyear(dy,y),day(dd,d),week(wk,ww),weekday(dw),hour(hh), minute(mi,n),second(ss,s), millisecond(ms),例子:

select datepart(year, '2023-04-13 08:45:00'); --2023
select datepart(month, '2022-12-13 08:45:00'); --12

B: 使用 date_part 代替,功能和 datepart 一样,写法不同,参数顺序颠倒,且都要加引号,例子:

select date_part('2023-12-13 08:45:00', 'year');--2023
select date_part
达梦(DM8) 数据库操作手册 达梦数据库(DM Database)是中国自主研发的一款关系型数据库管理系统,由达梦数据库公司(DM Technology Co., Ltd.)开发。 达梦数据库致力于不断创新和发展,积极参与国内外的数据库标准制定和技术交流,努力推动国产数据库的普及与应用。 总之,达梦数据库以其高性能、高可用性及安全性,成为国内企业和机构进行数据管理和应用开发的重要工具之一。 阅读详情

相关推荐

DM数据库体系架构详解

目录 一、逻辑架构 1.1数据库与实例 1.2逻辑存储 1.2.1表空间 1.2.2段 1.2.3簇 1.2.4页(数据块) 二、物理存储架构 2.1配置文件 2.1.1dm.ini 2.1.2 dmmal.ini 2.1.3dmarch.ini 2.1.4dmsvc.conf 2.1.5sqllog.ini 2.1.6其他 2.2控制文件 2.3数据文件 2.4重做日志文件 2.5归档日志文件 2.6 逻辑日志文件 2.7 物理逻辑日志文件 2.8 备份文件

weixin_46792121的博客 3552

达梦数据库迁移实战:从MySQL到DM的完整避坑指南(附若依框架适配技巧)

本文提供了一份从MySQL迁移至达梦数据库的完整实战指南,特别针对若依框架与MyBatis-Plus的适配问题。内容涵盖迁移前的环境准备、数据迁移工具使用、SQL语法差异处理(如REPLACE INTO转MERGE INTO)、分页及函数替换等核心适配技巧,并分享了性能优化与生产部署的最佳实践,帮助团队顺利完成国产化替代。

weixin_29243063的博客 1088

Nacos 适配达梦数据库:从 MySQL 迁到 DM8 的完整落地路径

在信创改造中,将注册中心和配置中心从 MySQL 迁移到达梦数据库是常见需求。Nacos 默认仅支持 MySQL,适配达梦需解决 SQL 方言、分页语法和主键生成等差异。通过编译自定义插件、改写建表脚本和调整连接参数,可实现 Nacos 与达梦 DM8 的兼容。这一过程涉及 JDBC 驱动配置、MERGE INTO 替代 upsert、分页查询优化等关键技术点,适用于需要国产化数据库替代的微服务架构场景。本文详细记录了从环境搭建到功能验证的完整路径,并针对常见报错如页面修改密码失败提供解决方案。

weixin_30522983的博客 247

Nacos 适配达梦数据库 DM8 实战:从 MySQL 迁移的五个关键步骤与避坑指南

在信创背景下,将 Nacos 的持久化存储从 MySQL 迁移到达梦 DM8 成为许多团队的刚需。Nacos 的持久化层硬编码了 MySQL 方言,迁移涉及建表脚本、JDBC 驱动、连接池参数、分页语法和主键策略五个层面的改造。达梦数据库作为国产数据库的代表,其与 MySQL 的语法差异直接影响 Nacos 的配置管理和服务发现功能。通过适配,可以确保 Nacos 在达梦上稳定运行,支撑政务、金融等关键行业的应用。本文基于实际项目经验,详细解析适配路径,涵盖建表脚本改造、JDBC 驱动配置、分页 SQL 改

weixin_33600816的博客 216

若依框架集成达梦数据库:从MySQL迁移到DM8的完整适配指南

在信创与国产化替代的大背景下,越来越多企业级应用需要从MySQL等传统数据库平滑迁移到达梦数据库(DM8)。数据库迁移不仅是驱动替换,更涉及SQL语法兼容、ORM映射调整、主键策略与分页方言等一系列技术细节。掌握这些原理,能大幅降低适配成本,提升系统在国产化环境中的稳定性和可用性。无论是政企项目、国企信息化系统,还是正在推进国产化改造的团队,都需要一套可复现的集成方案。若依作为Java生态中广泛使用的快速开发框架,其与达梦数据库的集成实践极具代表性。本文从环境准备、驱动配置、建表脚本转换、MyBatis X

weixin_32822843的博客 211

FastAdmin对接达梦数据库:ThinkPHP5驱动适配实战

在国产化替代趋势下,PHP项目如何将底层数据库从MySQL平滑迁移到达梦,成为许多团队关注的焦点。FastAdmin作为基于ThinkPHP5的常用后台框架,默认深度绑定MySQL。由于达梦数据库语法兼容Oracle,两者间的方言差异成为适配的核心瓶颈。本文从数据库驱动层入手,解析如何通过自定义PDO连接器和兼容层,实现FastAdmin对达梦的透明访问,并梳理了自增主键、分页、函数差异等关键改造点。这套适配方案适用于政企国产化项目,能显著降低迁移成本,让现有系统快速满足信创要求。结合FastAdmin与达

weixin_33835461的博客 243

Nacos 适配达梦数据库 DM8 实战:数据源、方言与分页改造

在信创环境下,将微服务从 MySQL 迁移至达梦数据库(DM8)时,Nacos 作为注册中心常因数据源方言不兼容而启动失败。其核心原理在于 Nacos 默认仅支持 MySQL 和 Derby,需扩展 JDBC 驱动、建表脚本、分页语法及健康检查 SQL。技术价值在于打通国产数据库与主流微服务组件的适配链路,确保配置管理的高可用。典型应用场景包括政务、金融等信创项目中的服务注册与配置中心改造。本文围绕达梦驱动选型、MyBatis 分页改写、连接池调优等关键环节,提供可复用的补丁方案与避坑指南。

weixin_32287387的博客 121

信息学奥赛一本通高手训练1680:序列

题目 代码 #include<cstdio> #include<iostream> #include<cmath> #define LL long long using namespace std; const LL N = 1400000+7; const LL mod = 1e9+7; int n, t; LL pos[N], sum[N], ans[N]; struct node{ LL ll, rr; }a[N]; int main(){ p

qingfeixueyue的博客 468

从VoLTE高清通话到5G新通话:手把手带你用Wireshark抓包分析QCI 1, 2, 5, 9的建立与切换过程

本文详细解析了从VoLTE高清通话到5G新通话的QCI(QoS Class Identifier)建立与切换过程,通过Wireshark抓包实战演示如何分析QCI 1、2、5、9的承载机制。内容涵盖QCI基础概念、实验环境搭建、VoLTE通话建立过程分析以及5G新通话中的QoS演进,为网络工程师和通信技术爱好者提供实用的技术指南和优化建议。

weixin_30788619的博客 342

智能解决装箱问题:使用优化算法实现高效包装

装箱问题(Bin Packing Problem)是组合优化领域中的一个经典问题,主要涉及如何将一系列对象高效地装入有限数量的容器(或“箱”)中,同时满足特定的约束条件。这个问题的目标是最小化所需使用的箱子数量或者最大化箱子的装载效率,以减少空间或资源的浪费。

MindOpt_003的博客 5544

使用GDScript(godot)生成仿杀戮尖塔地图

使用GDScript(godot)生成仿杀戮尖塔地图 extends Node2D export (PackedScene) var Ball var 被连接数 = {} # 每个怪物被下层怪物连接的数量 最多为2 var 连接1 = {} # 第一次连接的上层怪物位置 var 连接2 = {} # 第二次连接的上层怪物位置 var 怪物数量 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0] # 每层怪物的数量 var 总层数 =8 # 总层数 var 怪物坐标行 = {} #

weixin_45038716的博客 3010

在Ultralytics YOLO中添加/更换模块详细指南

使用参数继承 my_module_args: &my_args [64, 3, 0.5] # 定义参数模板 backbone: - [-1, 1, MyModule, *my_args] # 引用参数。

MR_Colorful的博客 2583

knowhere | 第一课:项目导论与环境搭建

摘要 本课程是Knowhere项目的第一课,重点介绍项目整体架构和开发环境搭建。Knowhere定位为AI Agent的文档记忆基础设施,通过解析多格式文档并保留结构化信息(如章节层级、表格语义等),为Agent提供可导航的文档知识。项目采用Python monorepo结构,核心包括: apps/api:FastAPI服务,处理HTTP请求和流程调用 apps/worker:Celery服务,执行文档解析等耗时任务 packages/shared-python:共享基础设施层 课程明确了各层职责边界,并推

weixin_43674738的博客 151

OpenClaw 在 Docker 容器中的部署实战——零配置启动

本文介绍了OpenClaw在Docker容器中的快速部署方法,对比了本地部署与容器化部署的优势。通过官方镜像和Docker Compose两种方式,5分钟即可完成部署,并详细讲解了配置管理方案(挂载配置文件和环境变量)。文章还提供了飞书集成配置方法,以及生产环境下的日志管理、资源限制、健康检查等优化建议。最后包含常见问题排查指南,帮助开发者快速实现OpenClaw的容器化部署。

刘一说的IT专栏 904

Allegro174版本如何关闭模块复用后铜皮自动从动态变成静态操作指导

在用Allegro进行PCB设计的时候,模块复用是使用的十分频繁的操作,当Allegro升级到了174 S034版本的时候,当使用模块复用的功能的时候,模块内的铜皮会自动动静转换,大部分情况是不需要的。版本如何关闭模块复用后铜皮自动从动态变成静态操作指导。如何关闭这个功能,具体操作如下。

weixin_54787054的博客 1258

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

上一篇: 【设计模式】23种设计模式之行为型模式
下一篇: 【MongoDB】MongoDB分布式文件存储的数据库
智汇风渔AI小白
博客等级 码龄7年 1万+粉丝 179原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

智汇风渔AI小白

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值