自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

追梦者xuaner

每一天都在成长

  • 博客(39)
  • 收藏
  • 关注

原创 try-catch-finally执行顺序验证

try-catch-finally执行顺序验证(左边是.java文件,右边是.class文件)提示:try-catch-finally的return在编译阶段做的优化,参考.class文件可以知道return的是哪个值。总结:对于return x,无论x是基本类型还是引用类型。如果finally块内有return,则采用finally块中return时的x值;如果finally块内没有...

2020-05-05 20:35:41 759

原创 Mysql学后总结

一、mysql的特性: ACID:原子性,一致性,隔离性,持久性二、mysql的索引 索引的分类: 普通索引(一个以上字段为组合索引) 唯一索引(一个以上字段为组合索引) 主键索引 覆盖索引 全文索引 创建索引的时候需要考虑: 结合实际业务场景,在哪些字段上创建索引,创建什么类型的索引。 ...

2020-03-10 23:22:47 324

原创 mysql5.7主从配置

一、主库(10.159.186.149)配置修改配置文件/etc/my.cnf:开启binlog日志,添加server_id重启mysql:service mysql restart登录mysql:mysql -u root -p访问mysql库:use mysql;新建存库可访问账号slave并赋予权限:select user,authentication_string,host f...

2019-10-31 17:31:34 230

原创 Linux防火墙开放某个端口

以下以开放mysql的3306端口为例:firewall-cmd --zone=public --add-port=3306/tcp --permanentfirewall-cmd --reload//刷新防火墙firewall-cmd --list-ports//查看所有开放端口

2019-10-31 17:02:05 146

原创 Linux手动卸载mysql8

1.find / -name mysql2.rm -rf 以上路径

2019-10-29 17:13:15 166

原创 Linux手动安装mysql8过程中遇到的异常信息

报错信息一:mysqld_safe error: log-error set to ‘/var/log/mariadb/mariadb.log’, however file don’t exists. Create writable for user ‘mysql’.解决方法:mkdir /var/log/mariadbtouch /var/log/mariadb/mariadb.logc...

2019-10-29 17:11:49 290

原创 Linux手动安装mysql5.7.28过程中遇到的异常信息

问题一:my_print_defaults: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1!my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!/etc/init.d/mysq...

2019-10-29 17:10:00 2059

原创 mysql5.7.28允许远程主机访问

转到mysql库 use mysql;查看mysql用户信息: select User,Host from user;修改mysql root用户信息,并授予权限 update user set host = % where user = root; grant all privileges on *.* to root@'%' with grant option;...

2019-10-29 17:06:13 1123

原创 Linux手动安装mysql5.7.28

1.官网下载2.解压tar.xz文件: 1:xz -d file.tar.xz 2:tar -xvf file.tar.xz3.重命名 mv mysql-8.0.18-linux-glibc2.12-x86_64 mysql4.添加系统mysql组和mysql用户groupadd mysql useradd -r -g mysql mysql5.修改解压后的mysql目录...

2019-10-29 16:59:59 2543

原创 Linux手动安装JDK

1.官网下载:jdk-xxxxxx.tar.gz;2.放到linux服务器某个目录下边,例如:/usr/local/jdk/;3.解压:tar -zxvf jdk-xxxxxx.tar.gz;4.配置环境变量:vi /etc/profileexport JAVA_HOME=/usr/local/jdk/jdk1.x.x_xxxexport CLASSPATH=$:CLASSPATH:$J...

2019-10-22 19:27:56 111

原创 interrupted()跟isInterrupted

一、源码:public static boolean interrupted() { return currentThread().isInterrupted(true); }public boolean isInterrupted() { return isInterrupted(false); }private native boolean...

2019-10-22 18:05:11 101

原创 mysqlbinlog工具的使用

1.查看最新的binlog状态:show master status;2.查看具体的binlog文件:show binlog events in “mysql-bin.000004” from 154 limit 2,2\G (注意没有分号)3.产生新的日志文件:flush logs;4.重置日志,删除所有日志文件:reset master;5.还原数据库数据:D:\mysql-5.7.2...

2019-10-15 20:43:29 652

原创 windows下免安装版本mysql打开binlog的方法

步骤一:在根目录下新建my.ini文件,具体内容如下[mysqld]log-bin=D:/mysql-5.7.28-winx64/data/binlog/mysql-binbinlog-format=Rowserver-id=125步骤二:重启mysqlnet stop mysqlnet start mysql步骤三:查看是否开启binlogshow variables lik...

2019-10-15 20:39:35 337

原创 windows免安装版mysql的安装方法

步骤一:下载mysql(免安装版)地址https://dev.mysql.com/downloads/mysql/步骤二:解压到某一目录D:\mysql-5.7.28-winx64步骤三:在bin目录下新建my.ini文件,具体内容如下[mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [mysqld] #设置3306端口...

2019-10-15 20:33:31 107

原创 mysql+zookper+canal环境下修改position的方法

修改canal position步骤:步骤一:查看mysql binlog日志,确定要开始的position,参考命令如下 查看有哪些binlog文件:show binary logs; 查看具体的binlog文件:show binlog events in "mysql-bin.000897"; 查看正在运行的binlog文件:show master status;步骤二:访问can...

2019-10-14 11:18:23 807 1

原创 linux grep

grep命令:包含 : grep ‘word’ filename不包含 : grep -v ‘word’ filename与关系 : grep word1 filename | grep word2 | grep word3;或关系 : grep -E ‘word1|word2|word3’ filename...

2019-10-10 20:27:15 88

原创 mysql+canal+zookper模式下新增数据库

mysql+canal+zookper环境已经搭建好的情况下,mysql新建了数据库test2,并且此新数据库的数据也得同步。则操作如下登录相应的canal服务器:采用secureCRT工具连接;进入canal的conf目录 :cd /tomcat/temp/canal/conf;新建目录:复制的已经存在的目录test1 cp -R test1 test2,这样就不用重新写instan...

2019-10-10 19:57:29 122

原创 shardingjdbc分页查询数据遇到问题

shardingjdbc分页查询是这样子:第一页LIMIT 0,10000第二页LIMIT 0,20000,然后合并排序后取前1000条第三页LIMIT 0,30000,然后合并排序后取前1000条 。。。。。。 越往后查越慢。咋办呢?可以在查询条件加个自增id,每次记录下最大id,查询这个id之后的数据;如果项目有使用elasticsearch,可以从elas...

2019-09-25 16:57:41 4492 2

原创 图数据库neo4j

ogm.properties配置文件indexes.auto=none时项目启动不会自动创建节点及索引,而且如果手动执行Cypher,当使用程序添加节点的时候,相应的索引会被覆盖;indexes.auto=update时,第一次启动项目相应的标签索引都会自动创建,第二次启动会删除索引再新建,则第二次项目启动会报错;indexes.auto=validate时,每次启动都会检测有无索引,没有则...

2019-09-24 20:36:35 213

原创 经验记录

关于创建数据库表结构1必须有自增id2记录入库的时间要加普通索引3考虑使用唯一索引来阻止并发4空字段值用一个默认值代替关于内存溢出循环内部的List集合使用完后必须清空...

2019-09-24 19:54:06 124

原创 logback异步日志配置

情况:从数据库看,数据都已经执行完成,但是前台仍然没有收到执行成功的反馈,一看控制台仍然在打印日志,这种情况可以使用logback异步日志使前台及时获得响应。logback.xml代码如下<?xml version="1.0" encoding="UTF-8"?><configuration debug="false"> <!--定义日志文件的存储地址 勿...

2019-09-17 14:09:27 6198 3

原创 分库分表情况下添加索引

/*存在则删除存储过程*/drop procedure if EXISTS add_index_while_procure;/*新建存储过程:给库.表的字段添加索引*/delimiter $$ /*创建带参存储过程 dbPrefixName库名称前缀;minBdNumber库最小序号;maxBdNumber库最大序号;tablePrefixName表名称前缀;minTableN...

2019-09-16 15:13:21 1952

原创 PowerDesigner根据SQL生成物理模型

1整理建表SQL语句到test.sql文件;2打开PowerDesigner->文件目录->Reverse Engineer->Database->General OBMS:选择MYSQL5.0->确定->Selection 选中Using script files 选择test.sql->确定;3执行完步骤二后模型已经显示出来;4如果想要name显...

2019-09-09 11:38:23 1000

原创 PowerDesigner设置code name不一致

工具标签->常规选项->Dialog目录->Name to Code mirroring取消选中->OK

2019-09-09 11:18:26 267

原创 Linux curl多参数且值有空格

场景:在Linux环境带多个参数访问,访问参数值有空格的情况;原地址:curl http://localhost:8080/com.baidu.cn?requestId=23233&requestTime=2019-07-01 00:00:00&endTime=2019-07-02 00:00:00结果:curl http://localhost:8080/com.baidu...

2019-08-01 10:23:32 5198 2

原创 mysql在有重复数据的情况下增加联合主键

**遇到的情况:**一张有两万多条数据的表,有重复记录,想通过添加复合主键来阻止后续的重复数据,但是原数据还不能删除,该怎么办?**解决方法:**复制表A的数据跟结构到A_COPY表,删除表A的数据,在表A上新建联合主键,将A_COPY表的数据通过忽略方式添加到表A,最后删除A_COPY表具体SQL:create table A_COPY select * from A;truncate ...

2019-07-23 21:32:35 1133

原创 idea实现springboot热部署

总结:热部署是为了方便开发。一、普通部署:1导入相关依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</op...

2019-04-30 11:57:22 309

原创 mybtis-springboot

感受:整合后只需要一个application.properties配置文件即可,感觉项目瘦身了。mybatis相关mapper.xml最好不要使用注解,这样子会降低代码的可读性、可维护性。整合步骤:1导入相关依赖 <!-- mysql驱动 --> <dependency> <groupId>mysql</groupId> &l...

2019-04-29 22:26:42 148

原创 java线程

1 java程序天生就是多线程,证明方法如下public class OnlyMain { public static void main(String[] args) { ThreadMXBean threadMXBean= ManagementFactory.getThreadMXBean(); ThreadInfo[] threadInfos=th...

2019-04-27 17:31:45 90

原创 mybatis-spring整合

mybatis与spring的集合,简化了SqlSessionFactory,SqlSession的获取,使得这些操作对我们都透明化1导入依赖包 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artif...

2019-04-27 12:33:12 89

原创 mybatis-generator代码生成器

1导入依赖<!--mybatis代码生成器--> <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> <version>1.3.5</...

2019-04-27 12:18:25 181

原创 mybatis学习后的总结(初级)

概括:1 mybatis是半自动化的ORM框架,之所以这么说是因为mysql需要自己写SQL语句;2 mybabtis的核心配置文件是mybatis-config.xml;3 mybatis是面向接口编程的;4 mybatis的核心接口是SqlSessionFactory;5 mybatis的实体、mapper接口、mapper.xml可以由代码生成器mybatis-generator生...

2019-04-27 11:49:22 202

原创 mysql语句

–添加列alter table user add column pass_word varchar(20) not null default '000000';–删除列alter table user drop column password;

2019-04-19 18:56:38 82

原创 Dos命令

1 进入D盘: d:2 显示目录下的所有文件: dir

2019-04-16 15:41:34 70

原创 IDEA导入maven项目

12选择要导入的项目345配置maven环境678导入后的项目名称及存放位置9完成导入

2019-04-15 15:48:44 106

原创 logback(2-2):每个用户一个日志文件

参考logback官方文档,地址为https://logback.qos.ch/manual/configuration.html;一、用IntelliJ IDEA新建maven项目;二、导入jar包:logback-classic-1.2.3.jar,logback-core-1.2.3.jar,slf4j-api-1.7.26.jar。pom.xml添加如下的dependency &...

2019-03-23 23:57:04 529

原创 logback(3):输出日志到数据库

参考logback官方文档,地址为https://logback.qos.ch/manual/configuration.html;一、用IntelliJ IDEA新建maven项目;二、导入jar包:logback需要的jar包 <dependency> <groupId>ch.qos.logback</groupId> ...

2019-03-23 23:33:15 2272

原创 logback(2-1):输出日志到文件

参考logback官方文档,地址为https://logback.qos.ch/manual/configuration.html;一、用IntelliJ IDEA新建maven项目;二、导入jar包:logback-classic-1.2.3.jar,logback-core-1.2.3.jar,slf4j-api-1.7.26.jar。pom.xml添加如下的dependency &...

2019-03-22 17:23:39 2176 3

原创 logback(1):搭建简单的logback框架

参考logback官方文档,地址为https://logback.qos.ch/manual/configuration.html;一、用IntelliJ IDEA新建maven项目;二、导入jar包:logback-classic-1.2.3.jar,logback-core-1.2.3.jar,slf4j-api-1.7.26.jar。pom.xml添加如下的dependency &...

2019-03-22 16:31:07 243

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除