![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
代码搬晕工
热爱生活
展开
-
update select
update select。原创 2022-08-11 10:05:25 · 154 阅读 · 0 评论 -
Result Maps collection does not contain value for
MyBatis报这个错的原因1.BaseResultMap不存在,如下<resultMap id="UserBaseResultMap" type="com.test.UserInfo">...</resultMap ><select id="selectUser" resultMap="BaseResultMap"> ...</select> resultMap标签 的id 是 UserBaseResultMap而select ...原创 2020-11-29 18:36:26 · 30664 阅读 · 1 评论 -
MySql 使用FIND_IN_SET 代替 IN
经常有这这样的需求,一个表里面有个字段存另一个表的id,多个ID逗号隔开,查询数据的话需要把对应数据查出来如 消息表 message(id,title,user_ids,message) 用户表 user(id,name) ,消息表里有个推送人字段 存多个用户id,查询消息要把对应的用户信息查出来比如user_ids存的字符串为"1,2,3" 这时候使用select * from user where user_id in ("1,2,3")#这样查出来的数据只有一条,因为"1,2,3"是..原创 2020-11-26 16:11:56 · 1786 阅读 · 0 评论 -
Linux搭建主主后没有同步数据,报Slave I/O for channel ‘‘错误
数据没有同步之后,查看日志看到错误(为了好看换行了)Slave I/O for channel '': error connecting to master 'repl@192.168.0.104:3306' - retry-time: 60 retries: 24 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. Er.原创 2020-07-29 15:42:20 · 4765 阅读 · 0 评论 -
MySQL8.0忘记密码、安装没初始密码解决
转自:https://www.cnblogs.com/nonsec/p/12869682.html修改my.cnf[mysqld] 域中添加skip-grant-tables重启mysqld服务service mysqld restart重新使用空密码登录,直接敲回车mysql -u root -p切换数据库,并将密码清空mysql >use mysql;mysql >update user set authentication_string = ''转载 2020-07-29 10:27:47 · 2731 阅读 · 3 评论 -
Linux系统MySQL启动报错The server quit without updating PID file (/usr/local/mysql/data/mysql01.pid).
到 /etc/init.d/ 找到mysqld(有的可能就是mysql(安装时一般都会把 mysql安装目录/support-files/mysql.server文件复制到/etc/init.d/(/etc/rc.d/init.d/)下最为服务名))找到之后编辑 mysqld找到start模块,添加 --user=root如图位置参考博文:https://blog.csdn.net/qq_36514672/article/details/81100981...原创 2020-07-28 16:45:00 · 675 阅读 · 0 评论 -
spring boot报错 java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' 解决
转载:https://www.cnblogs.com/cn-chy-com/p/10145690.html第一个错误信息Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatic...转载 2020-04-02 17:28:04 · 280 阅读 · 0 评论 -
MySQL查询所有表和视图
查询所有表select table_name as tableName from information_schema.tables WHERE table_schema = '数据库名称'查询所有视图select table_name as viewName from information_schema.views WHERE table_schema = '数据库名称'...原创 2019-11-05 18:38:29 · 1993 阅读 · 3 评论