![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
小森、
这个作者很懒,什么都没留下…
展开
-
mysql 存在就(不)更新,不存在就增加
总结一些在业务需求中,用到的mysql语句(不定时更新)1.on duplicate key update存在就update,不存在就insert在MySQL数据库中,如果在insert语句后面带上ON DUPLICATE KEY UPDATE 子句,而要插入的行与表中现有记录的某行的惟一索引或主键重复,就新;否则就插入。insert into job(job_id,job_priority) values(jobId,jobPriority) on duplicate key update jo原创 2021-07-08 17:20:07 · 1343 阅读 · 0 评论 -
MySQL连接异常
1.Could not create connection to database server.解决:MySQL8.0版本需要更换驱动为“com.mysql.cj.jdbc.Driver”。mysql-connector-java也推荐更新到8.0的版本。https://dev.mysql.com/downloads/connector/j/包括下面的错误,更改到新版本的connector好像都可以解决。2.Unknown initial character set index ‘255’ re原创 2021-01-31 15:14:12 · 96 阅读 · 0 评论