- 博客(19)
- 收藏
- 关注
原创 CentOS7安装 MySQL
在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要在系统中安装MySQL,而且安装完成之后可以直接覆盖掉MariaDB。1 下载并安装MySQL官方的 Yum Repository,Mysql版本5.7.14[root@localhost ~]# wget mysql57-community-release-el7-10.noarch.rpm使用上面的命令就直接下载了安装用的Yum Repository,大概25KB的样子,然后就可以直接yum安装了。[root@
2022-06-29 08:50:54 77
原创 数据库基础
查询语句:select * from 表名查询加去重:select distinct 字段名 from 表插入语句:insert into 表名(字段名…)values(数值…)update 表名set 字段=字段值 where 字段=字段值delete from表名 where 字段=字段数值...
2022-02-16 08:50:34 383
原创 java生成二维码
public static void main(String[] args)throws WriterException, IOException { QRCodeWriter qrCodeWriter = new QRCodeWriter(); Map x=new Hashtable(); x.put(EncodeHintType.CHARACTER_SET, "utf-8");//设置字符集 BitMatrix bitMatrix
2022-02-07 16:27:17 267
原创 java对象根据属性排序
方法一:将要排序的对象类实现Comparable<>接口。class Student implements Comparable<Student>{ String name; int age; int score; public Student(String name, int age,int score) { this.name = name; this.age = age; this.score = score; }
2022-01-12 10:26:10 1582
原创 Java计算两个经纬度间的距离方式
数据库guid varchardept_id varcharcreatetime timestamp//时间戳mapper.xml<result column="createtime" property="createtime" jdbcType="TIMESTAMP"/>javaBean@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")private Date create
2022-01-11 15:08:34 224
原创 MyBatis包含的jdbcType类型和java中对应的数据类型
<resultMap id="给ID名" type="实体类" ><result column="数据库字段名" property="实体类属性" jdbcType="数据库字段类型" /></resultMap>Mybatis中javaType和jdbcType对应和CRUD例子<resultMap type="java.util.Map" id="resultjcm"> <result property="FLD_NUMBER" c
2022-01-11 09:29:08 323
原创 改数据库密码mysql
方法1:用UPDATE直接编辑user表mysql> use mysql;mysql> update user set password=password(‘123’) where user=‘root’ and host=‘localhost’;mysql> flush privileges;方法2:忘记root密码时以windows为例:关闭正在运行的MySQL服务。打开DOS窗口,转到mysql\bin目录。输入mysqld --skip-grant-ta
2022-01-10 15:43:53 41
原创 别人链接你 mysql数据库
1.打开cmd运行mysql2.use mysql所有人以root 名 以abc为密码访问我的mysql3.grant all privileges on . to root@"%" identified by ‘abc’ with grant option4.flush privileges
2022-01-10 15:42:27 375
原创 获取当前日期到第几天日期星期几
public class date { public static void main(String[] args) { datebean test=new datebean(); Map<String,String> map=new HashMap<>(); for (int i = 0; i <7; i++) { Calendar calendar = Calendar.getInstanc
2022-01-08 17:39:35 136
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人