MySQL失败问题集

1.在创建MySQL存储过程是出现了

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4

该问题是由于在开始没有加delimiter $造成,导致的

2.在springboot进行多环境多环境搭建时出现:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).


证明数据库没有连接成功原因可能是在你在Dev环境中搭建配置了数据库但没有配置

spring:
   profiles:
     active: dev

3.在向数据库添加数据时出现

Incorrect string value: '\xF0\x9F\x90\xBB' for column 'nickName' at row 1

其原因是数据库的字符编码有问题,在插入中文时字节数不能对应

4.id没有默认字段

Field ‘id’ doesn’t have a default value

该问题为在添加数据时的sql语句没有加id字段导致,数据库添加时默认id自增,但是数据库却没有设置自增属性导致

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值