![](https://img-blog.csdnimg.cn/20190927151117521.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
数据库
mysql,sqlServer,access,redis 等数据库遇到的问题以及解决方式
零碎記忆
不要跟我比懒,我懒得跟你比~
展开
-
mysql密码过期的修改(Your password has expired. ..)
问题:Your password has expired. To log inyou must change it using a clientthat supports expired passwords.以root@% 为例 > set password for 'root'@'%' = password('123456');注意:user、host对应一个密码,要确认好是哪个用户的哪个host密码过期。解决方式:修改指定用户的password。1.先查询主机、用户、密码的最后修改时间。转载 2024-06-19 18:53:49 · 281 阅读 · 0 评论 -
2023-02-07 mysql创建user并配置权限
配置权限时遇到问题 access denied for user ''@'localhost' to database 一直解决不了,后来通过新建连接的方式解决,新的连接没有这个问题,具体原因还是不清楚。展示用户new-sql-test的权限 show grants for 'new-sql-test'@'%';创建用户 CREATE USER '用户'@'%' IDENTIFIED BY '密码'原创 2023-02-07 18:31:11 · 433 阅读 · 0 评论 -
2022-09-15 sql的update(使用select结果进行update)
id | 主键id | |id | 主键id ||code |类型编码 | |category_code | 学生类型编码 ||name |类型名称 | |category_name | 学生类型名称 |转载 2022-09-15 14:28:08 · 616 阅读 · 0 评论 -
2022-07-07 sql查询关于时间日期的使用 (本周数据、上午,下午数据)
参考连接:mysql 查询本周,本月,本年数据sql、sql查询本周、本月数据需求:获取本周(周一到周日)的数据date_format是将时间日期转换为时间格式,2022-07-07 09:48:33 转换为2022-07-07 YEARWEEK 是获取年份和周数的一个函数,函数形式为 [,])......转载 2022-07-07 17:58:37 · 1802 阅读 · 1 评论 -
2021-09-22 sql中的函数使用记录
MySQL group_concat()函数https://www.yiibai.com/mysql/group_concat.htmlGROUP_CONCAT函数的使用GROUP_CONCAT :将分组后的多个结果以字符串的形式拼接;DISTINCT:去重;SEPARATOR :需要配合 使用, 默认是逗号 ",",我这里用的";"SELECT GROUP_CONCAT(DISTINCT v ORDER BY v ASC S..转载 2021-09-22 11:26:34 · 140 阅读 · 0 评论 -
2021-02-20 SQLServer数据库文件mdf和ldf的导入及导出、迁移
SQLServer数据库文件mdf和ldf的导入及导出转载 2021-02-20 09:21:56 · 3417 阅读 · 0 评论 -
2021-02-19 可视化工具Redis Desktop Manager安装
可视化工具Redis Desktop Manager安装转载 2021-02-19 09:20:35 · 1944 阅读 · 0 评论 -
access筛选后的数据如何导出
参考链接:https://iask.sina.com.cn/b/gWL5tbqFINWX.html1.创建 -> 查询向导 -> 简单查询向导2.选择需要筛选查询的表、和需要查询的字段3.单击下一步,最后单击完成,得到的内容如下4.单击箭头指的地方,修改sql语句,然后运行,查询下方会出现筛选查询之后的表...原创 2020-01-19 13:56:55 · 5745 阅读 · 0 评论 -
2021-01-27 使用SQLyog同步sqlserver数据到mysql中,出现问题
使用SQLyog同步sqlserver数据到mysql时出现问题 ERROR: 1067, Invalid default value for 'createDate' ...`createDate` timestamp(6) NOT NULL DEFAULT NOW()...错误原因:createDate的默认值是NOW()解决方式:删掉默认值NOW()由于使用timestamp存储的时间不能大于“2038-01-19 03:14:07”,否则会报错,原因可参考...原创 2021-01-27 14:52:24 · 293 阅读 · 0 评论 -
2021.06.25 mysql命令行
参考链接 select * from test where p_id in ( select p_id from test where p_ids LIKE '%111%' and id = 222)原创 2021-06-25 11:33:30 · 2153 阅读 · 0 评论 -
2021-02-05 得到指定日期区间内容,预警需要
1.查询的是日期前后距离一共14天的内容select * from userwhere DATEDIFF(createDate,now()) < 72.查询指定时间段的内容select * from userwhere date BETWEEN '2021-02-23' and '2021-02-25'原创 2021-02-05 11:09:17 · 322 阅读 · 0 评论 -
sqlservcer迁移数据到mysql
转载链接:https://blog.csdn.net/huangyuhua068/article/details/82027442转载 2020-12-04 14:01:51 · 185 阅读 · 0 评论 -
云服务器 ECS MySQL 设置数据库表名区分大小写
宝塔设置不区分大小写、MySQL 设置数据库表名不区分大小写、Linux 系统中的MySQL数据库默认区分大小写select pi.production_instruction_id,PI.count as un_count from production_instruction as pi left join (select COUNT(production_instruction_id) as count from production_instruction where stat转载 2020-11-20 14:29:50 · 263 阅读 · 0 评论 -
sql连接问题(useSSL=true)
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureThe last packet successfully received from the server was 69 milliseconds ago. The last packet sent successfully to the server was 64 milliseconds ago. at sun.refle...转载 2020-11-13 15:22:11 · 4365 阅读 · 0 评论 -
mysql不能使用group by查询
Cause: java.sql.SQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY错误https://blog.csdn.net/weixin_45100596/article/details/100085012转载 2020-06-04 14:18:00 · 817 阅读 · 1 评论 -
sql语句字符串型数字排序
转载链接:https://blog.csdn.net/weixin_41402352/article/details/82288831order by 字段名称+0 desc/asc的形式进行排序 order by 字段名称*1 desc/asc的形式进行排序转载 2020-05-26 15:12:11 · 2075 阅读 · 0 评论 -
MySQL使用UNION连接两个查询排序失效
转载链接:https://www.cnblogs.com/runningRookie/p/11108770.html select a.id,a.name,a.age from testa union select b.id,b.name,b.age from testb order by age转载 2020-05-22 10:48:12 · 346 阅读 · 0 评论 -
使用phpstudy打开本地数据库有问题
本地数据库打不开使用phpstudy运行本地数据库,启动的时候会提示这个错误,但是可以正常启动,但是使用就会出现上面的问题卸载重新安装,安装目录只能有英文字母...原创 2020-04-29 10:39:28 · 1045 阅读 · 0 评论 -
mysql服务无法启动
转载链接:https://bbs.csdn.net/topics/391851148?list=19981256mysqld -removemysqld -installmysqld --initializenet start mysql转载 2020-04-29 09:19:39 · 374 阅读 · 0 评论 -
HTML转义字符对照表
https://tool.oschina.net/commons?type=2在sql中的 COALESCE(count,0) != 0相当于 IFNULL(count,0) != 0不断开空格(non-breaking space) < << &...转载 2020-04-01 18:22:04 · 196 阅读 · 0 评论 -
sql字符串转换成小数(decimal)
select goods_id,IFNULL(months,0) as months from goods where IFNULL(months,0) <= cast('12.0' as decimal(18,1))原创 2020-03-11 19:30:41 · 7882 阅读 · 0 评论 -
sql计算除法保留小数
https://blog.csdn.net/lvjianyu2007/article/details/45870617/CAST(数据 AS DECIMAL(10,保留位数)select IFNULL(CAST(total/10000 AS DECIMAL(10,0)),0) as totalfrom reporthttps://blog.csdn.net/clearss/ar...转载 2019-12-30 10:40:33 · 4713 阅读 · 0 评论 -
sql判断null和空字符串的字段
转载链接 :https://blog.csdn.net/weixin_43554218/article/details/85047161判断某个字段不为null : name is not null判断某个字段不为空字符串: name != ''转载 2019-11-04 11:56:29 · 5700 阅读 · 0 评论 -
sql 得到分组后的数量
转载链接 :https://zhidao.baidu.com/question/124829847.html?qbl=relate_question_0SELECT COUNT(*)FROM (SELECT 分组字段 FROM 表GROUP BY 分组字段)别名或者SELECT COUNT(*)FROM (SELECT distinct 分组字段 FROM 表)别名...转载 2019-11-01 13:39:57 · 1634 阅读 · 0 评论