前两天在开发中遇到一个坑,本来我在快乐的做着增删改查,然后悲剧发生了,在查询数据库的过程中,报了java.sql.SQLSyntaxErrorException: 经过排查,是因为数据库表字段中存在关键字: 下面重点来了,我用的是mybatis-plus,我的解决方案如下: 在这个字段上增加@TableField(value="`key`")注解即可,用``将字段包起来,是英文半角状态下的数字1前面的那个符号. 再运行起来就没问题啦 one more thing: 1.如果你用的是jp
删除库的时候报错 ERROR: database "temp_test_yang" is being accessed by other usersDETAIL: There are 4 other sessions using the database. 说明该temp_test_yang库正在被人连接.解决方法是: 查询出连接该数据库的进程,并将其杀死(比较暴力) select pg_terminate_backend(pid) from pg_stat_activity wh
django2.0+连接mysql数据库迁移时候报错 情况一 错误信息 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3. 解决办法 去到\python\lib\site-packages\django\db\backends\mysql\base.py" 把里面的注释掉 # if version < (1, 3, 13): # raise
重新进行启动数据库的时候报错: SQL> startup nomount; ORA-15124: ASM file name '+KEL/ipap/controlfile/control02.ctl'' contains an invalid alias name 由于是启动到nomount阶段,此时只有spfile文件起作用,从而是因为spfile文件里的参数设置出错,从而导致错误 检查之后,发现参数设置错误: SQL> alter system set control_files='+KE
在使用Navicat for MySQl访问远程mysql数据库,出现报错,显示“1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“.解决办法如下: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION 把他运行一下就行了.
遍历List集合删除元素的出现报错 遍历List集合删除元素的时候会发生索引越界异常或内容遍历不全等问题. 例子: List<String> al = new ArrayList<String>(); al.add("12"); al.add("1"); al.add("13"); int size = al.size(); 问题1:索引越界异常Exception in thread "main"
项目中的几个需要支持Emoji表情符号,手机自带的表情,其实添加也很简单: 1 修改数据库 配置my.cnf init-connect='SET NAMES utf8mb4' character-set-server=utf8mb4 2 修改表字段字符集为utf8mb4 ALTER TABLE post_replay MODIFY replay_content TEXT CHARACTER SET utf8mb