随笔分类 -  MYSQL

MYSQL
摘要:设置MySQL 创建数据库,默认为UTF-8 下载地址:https://downloads.mysql.com/archives/installer/ 安装 网站上只有 x86 没有 x64 位,之前下了 x64 的zip 包,配置比较麻烦,其实这个 x86 包里面,已经包含了 x64的包 我这边选 阅读全文
posted @ 2022-10-14 09:54 VipSoft 阅读(341) 评论(0) 推荐(0)
摘要:一、安装MySQL 1. 删除Mysql 数据库 sudo apt autoremove --purge mysql-server-* sudo apt remove mysql-server sudo apt autoremove mysql-server sudo apt remove mysq 阅读全文
posted @ 2022-08-25 13:18 VipSoft 阅读(4970) 评论(2) 推荐(0)
摘要:Error Code : 1381You are not using binary logging show variables like '%log_bin%'; 在mysqld配置项下面加上log_bin=mysql_bin [mysqld] log-bin="C:/Program Files/ 阅读全文
posted @ 2022-06-30 09:29 VipSoft 阅读(320) 评论(0) 推荐(0)
摘要:如图:我们将删除 id=2的数据,并恢复 SHOW BINARY LOGS; You are not using binary logging show binlog events in 'mysql-bin.000001' 导出删除日期范围内的binlog日志 #根据时间段 mysqlbinlog 阅读全文
posted @ 2022-06-30 09:26 VipSoft 阅读(510) 评论(0) 推荐(0)
摘要:备份数据库文件时,发现MySQL备份生成的文件名为 【vipsoft_周三】,发现是系统的日期格式问题。需调整日期格式,生成 【vipsoft_20220601.sql】 mysqldump -uroot -p110 vipsoft > D:\DBBackup\MySQL\vipsoft%Date: 阅读全文
posted @ 2022-06-01 10:26 VipSoft 阅读(158) 评论(0) 推荐(0)
摘要:推荐 使用 Windows 安装 MySQL 5.7 x64 位 方案 MySQL 5.7 下载:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 下载后解压,将解压包放到 :D:\MySQL\mysql-5.7.30-winx64 ( 阅读全文
posted @ 2022-04-26 10:45 VipSoft 阅读(88) 评论(0) 推荐(0)
摘要:https://downloads.mysql.com/archives/community/ 选择需要的版本,5.7.32~36 不支持Mac系统 下载后双击进行安装,一跳点下去(5.7以前默认密码是 root ,5.7以后会随机分配,安装过程中会弹出一个临时密码让你保存) 安装完成后,进入系统偏 阅读全文
posted @ 2022-03-03 23:36 VipSoft 阅读(109) 评论(0) 推荐(0)
摘要:一套代码,多家部署时,在SQL脚本升级时,通过一个SQL文件给运维,避免出现SQL执行序顺出错及漏执行SQL SQL Server 项目中 SQL 脚本更新方式 Oracle 项目中 SQL 脚本更新方式 MySQL 项目中 SQL 脚本更新、升级方式,防止多次重复执行 MySQL 中不像 Orac 阅读全文
posted @ 2021-12-29 09:44 VipSoft 阅读(744) 评论(0) 推荐(0)
摘要:MySQL server version for the right syntax to use near 'IF' MySQL server version for the right syntax to use near '' MySQL server version for the right 阅读全文
posted @ 2021-12-29 09:30 VipSoft 阅读(541) 评论(0) 推荐(0)
摘要:在不改程序的情况下,修改 sql 时,需要将 Mapper 中的 XML 文件 放到外面 mybatis: mapper-locations: classpath:mapper/*.xml #JAR 包里面 mybatis: mapper-locations: file:mapper/*.xml # 阅读全文
posted @ 2021-07-08 15:09 VipSoft 阅读(1709) 评论(4) 推荐(0)
摘要:MySQL 事务回滚。在执行删除、更新等操作时,防止误操作 生产环境更新数据时必用 begin tran --开启事务 begin--先在事务中 执行 UPDATE Sys_User SET Name='张三' where Id='a46d92fb-5c7b-45e7-8571-5eae426578 阅读全文
posted @ 2021-03-18 09:40 VipSoft 阅读(901) 评论(0) 推荐(0)
摘要:[root@centos-linux jimmy]# firewall-cmd --state not running [root@centos-linux jimmy]# sysctl net.ipv4.ip_forward net.ipv4.ip_forward = 0 [root@centos 阅读全文
posted @ 2020-07-04 00:13 VipSoft 阅读(1026) 评论(0) 推荐(0)
摘要:Content 字段是 text 类型(Text是6万多)改成了 longtext 就OK了 ALTER TABLE `Article` CHANGE `Content` `Content` LONGTEXT NULL 阅读全文
posted @ 2020-06-15 16:49 VipSoft 阅读(9939) 评论(0) 推荐(0)
摘要:SQL Server 事务执行、回滚 MySQL 事务回滚。在执行删除、更新等操作时,防止误操作 SELECT * FROM TABLE_NAME I WHERE I.TRANS_NO='P-2019000025'; # 原始数据 START TRANSACTION; SELECT COUNT(1) 阅读全文
posted @ 2020-03-12 15:47 VipSoft 阅读(843) 评论(0) 推荐(0)
摘要:项目中用的 5.7 版本,所以这边命令后面会带上版本号 [root@localhost ~]# docker pull mysql:5.7 docker run -p 3306:3306 --name mysql5.7 -v /conf/mysql:/etc/mysql/conf.d -e MYSQ 阅读全文
posted @ 2020-03-10 17:53 VipSoft 阅读(290) 评论(0) 推荐(0)
摘要:SQL SERVER 查询所有表 统计每张表的大小 1.查看所有数据库容量大小 select table_schema as '数据库', sum(table_rows) as '记录数', sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)', 阅读全文
posted @ 2020-01-03 15:12 VipSoft 阅读(3862) 评论(0) 推荐(1)
摘要:Window bat expdp 定时任务 自动备份数据库 定时删除N天前的旧文件 Linux shell crontab expdp 定时任务 自动逻辑备份数据库脚本 定时删除旧文件 大SQL文件导入 设变量 max_allowed_packet 也可以导入时临时设置 [root@localhos 阅读全文
posted @ 2019-05-30 19:30 VipSoft 阅读(949) 评论(0) 推荐(0)
摘要:【注意】 1.首先安装在默认目录 /usr/local/mysql,如需更改数据存储目录,进行2、3两步 2.如果需要修改数据目录,将my.nf 中的 datadir=/usr/local/mysql/data 进行修改 3.将 /usr/local/mysql/data 中的文件复制到修改后的目标 阅读全文
posted @ 2019-05-24 13:37 VipSoft 阅读(1362) 评论(0) 推荐(0)
摘要:点击进入:Linux shell crontab expdp 定时任务逻辑备份 定时删除旧文件 首先建一个备份数据库用批处理文件,内容如下: rem expdp sz set sz_file=SZ_%date:~0,4%%date:~5,2%%date:~8,2%.dmp set sz_logfil 阅读全文
posted @ 2016-11-17 15:43 VipSoft 阅读(3066) 评论(0) 推荐(1)
摘要:mysql根据配置文件会限制server接受的数据包大小。有时候大的插入和更新会受max_allowed_packet 参数限制,导致写入或者更新失败。查看目前配置show VARIABLES like '%max_allowed_packet%';显示的结果为:+-----------------... 阅读全文
posted @ 2015-06-05 21:02 VipSoft 阅读(21289) 评论(0) 推荐(0)