![](https://img-blog.csdnimg.cn/3103296edc98431abba9000afeeba1bd.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
strom-MySQL-数据库学习
MySql-数据库学习
行人已
小白程序员进阶路
展开
-
mysql : Too many connections
mysql : Too many connections原创 2022-11-07 12:53:17 · 405 阅读 · 0 评论 -
mariadb Access denied for user ‘root‘@‘localhost‘
mariadb Access denied for user 'root'@'localhost'原创 2022-09-02 17:35:46 · 935 阅读 · 0 评论 -
Mysql Varchar类型 字段排序
Mysql Varchar类型 字段排序1、问题描述:当列表需要字段大小排序的时候,但是数据库字段是Varchar类型的,如果仔细看就会发现并没有按照预期来拍,比如:不是按照:10,9,8,7 这样来的~如果是varchar 类型其实照字符串来排的,我的理解就一排一排来排序,第一排数值比对,然后在第二排。。2、问题解决:在排序的字段后**+0** ORDER BY (字段+0) asc为什么+0后可以,是因为+0后转换成INT类型排序了, 这样就可以按照大小排序了使用MySQL函数C原创 2022-03-15 18:00:01 · 5183 阅读 · 0 评论 -
Unable to parse the date: 2021-05-27T16:00:00.000Z
Unable to parse the date: 2021-05-27T16:00:00.000Z原因是:在格式化时间的时候,转成 “yyyy-MM-dd” 类型的数据的时候回报错!T表示分隔符,Z表示的是UTC。UTC:世界标准时间,在标准时间上加上8小时,即东八区时间,也就是北京时间。解决:Date:String dateTime = "2021-05-13T16:00:00.000Z";String strTime = dateTime.replace("Z", " UTC");原创 2021-05-28 19:04:09 · 3720 阅读 · 0 评论 -
Mybatis-批量更新: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax
1、遇到错误nested exception is java.sql.sqlsyntaxerrorexception: you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near2、代码写法:<update id="updateByList" parameterType="java.uti原创 2021-04-09 00:37:40 · 979 阅读 · 0 评论 -
Could not create connection to database server. Attempted reconnect 3 times. Giving up
1、错误原因mysql的时区设置的不正确 mysql默认的是美国的时区2、解决方法增加:serverTimezone=UTC url: jdbc:mysql://xx:3306/test?serverTimezone=UTC换版本mysql—5.1.28...原创 2020-02-07 13:49:38 · 4585 阅读 · 0 评论 -
Maven:Could not find artifact and 'parent.relativePath' points at wrong local POM @ line 5, column 1
1、问题描述试用 springBoot 聚合工程Clean或者是install 的时候总是出现Could not find artifact and ‘parent.relativePath’ points at wrong local POM @ line 5, column 13这样的错误2、问题解决这是因为你主聚合函数没有导入到本地的maven仓库里面去所以导致子工程获取不到ma...原创 2020-01-09 15:51:29 · 4162 阅读 · 0 评论 -
mybatis 注解 SQl 中 if test= 无效
1、问题描述在我使用多条件查询的时候,使用打印sql 后发现并没有有效2、问题解决sql:" <script> SELECT * "+ " FROM `t_blocks` " + " where coin=#{coin} " + " <if test=\"search != null\">and blockhash = #{search} &...原创 2019-12-11 13:35:36 · 1373 阅读 · 1 评论 -
Springboot + mybatis-generator自动生成代码
???? 写在前面写在篇文章的目的主要在于自己以后用到的时候 可以直接来copy,同时也给正在学习和奋斗的你一个更简单直白的方式来撸代码,工具是用来方便和服务的,本来网上文章很多,但是我觉得写的太多了有点儿不直接,就自己来了一篇???? 直接上代码https://github.com/Reallyone/springboot-model/tree/master/mybatisgenerator(直接下载后可以运行测试)???? 晚上小感最近发现自己越来越懒,不愿意去深究其中原因,代码就直接能查原创 2020-05-21 22:52:40 · 241 阅读 · 0 评论 -
MyBatsiPlus: Error updating database. Cause: java.sql.SQLException: Field 'id' doesn't have a defaul
1、问题原因Mysql中没有将主键设置为自增,所以在使用Mybatis时获取生成主键时出现异常2、问题解决查看数据库是否设置了自增如果不需要自增,查看数据ben里面是否设置了@TableId 注解...原创 2020-04-27 10:09:37 · 1061 阅读 · 0 评论 -
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempt
1、问题原因mysql时区识别出现错误2、问题解决在url 加上时区url: jdbc:mysql://127.0.01:3306/user?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&**useSSL**=false&zeroDateTimeBehavior=convertToNul...原创 2020-02-07 19:55:54 · 4344 阅读 · 0 评论 -
解决Mysql :datetime(0) NULL DEFAULT NULL报错
1、错误信息CREATE TABLE `file` ( `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件md5', `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT N...原创 2020-02-06 16:31:50 · 14864 阅读 · 1 评论 -
SQL state [HY000]; error code [1412]; Table definition has changed, please retry table
1、问题描述发现日志中每天都会有这个错误:java.sql.SQLException: Table definition has changed, please retry xx; uncategorized SQLException; SQL state [HY000]; error code [1412]; Table definition has changed, please ret...原创 2019-12-17 11:45:03 · 2578 阅读 · 0 评论 -
mariadb 非本机访问解决办法.txt
解决- mariadb 非本机访问办法第一步:查看用户账号信息:(要授权的服务器Mariadb)select User, host from mysql.user;第二步:GRANT ALL PRIVILEGES ON . TO ‘root’@‘你的连接配置’ IDENTIFIED BY ‘my-new-password’ WITH GRANT OPTION;解释一下:my-n...原创 2019-09-21 14:40:40 · 357 阅读 · 0 评论 -
mysql数据库不能存入中文
mysql数据库不能存入中文废话不多说:1、查看字符集编码show variables like 'char%'2、直接修改set character_set_client = utf8;set character_set_server = utf8;set character_set_connection = utf8;set character_set_database ...原创 2019-05-07 11:37:19 · 2721 阅读 · 2 评论