明天的明天 永远的永远 未知的一切 我与你一起承担 ??

是非成败转头空 青山依旧在 几度夕阳红 。。。
随笔 - 1277, 文章 - 0, 评论 - 214, 阅读 - 320万
  博客园  :: 首页  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  MySQL

摘要:1.首先my.ini文件要是保存为ansi格式 , 必须。 2.其次别忘了加**[mysql]** 设置mysql客户端默认字符集 [mysql] default-character-set=utf8 [mysql] # 设置mysql客户端默认字符集 default-character-set=u 阅读全文

posted @ 2022-07-06 18:18 且行且思 阅读(364) 评论(0) 推荐(0) 编辑

摘要:mysql 8WITH ranked_messages AS ( SELECT m.*, ROW_NUMBER() OVER (PARTITION BY name ORDER BY id DESC) AS rn FROM messages AS m)SELECT * FROM ranked_mess 阅读全文

posted @ 2022-06-28 15:17 且行且思 阅读(1245) 评论(0) 推荐(0) 编辑

摘要:1、在我们的电脑上面找到mysql的安装路径,点击进去。 2、进去之后可以看到my.ini在mysql安装路径的根目录,这是其中一种情况。 3、另外一种情况是我们在mysql安装目录找不到,看到了my-default.ini文件,这时my.ini在“C:\ProgramData\MySQL\MySQ 阅读全文

posted @ 2021-12-21 11:39 且行且思 阅读(1757) 评论(0) 推荐(0) 编辑

摘要:长时间不用mysql,密码忘记了怎么办,按照下面的步骤可以重新设置密码:1、先把mysql服务停了,右键计算机--》选择管理--》选择服务和应用程序--》选择服务--》找到mysql,停止它 2、打开mysql的安装路径,编辑my.ini文件,再最后一行加入:skip-grant-tables(数据 阅读全文

posted @ 2021-12-02 14:02 且行且思 阅读(1862) 评论(0) 推荐(1) 编辑

摘要:select real_name as 姓名, a.phone as 手机号,id_card_no as 身份证号,id_card_type as 证件类型, a.address as 地址,f.num as 证件数量, f.card as 内含证件类型, c.name as 村小组名称, a.cr 阅读全文

posted @ 2021-11-30 15:02 且行且思 阅读(122) 评论(0) 推荐(0) 编辑

摘要:从事IT行业十五年+,最近有个运行中项目的列表页面,在本地测试台式机执行效率在三秒以内,布署到服务器(32G内存,16G Cpu)后反而执行20秒+ ,百思不得其解。 解决办法 ※以下部分内容来自博主的文章 1.首先查看max_write_lock_count 我个人认为这不是报错的主要原因,因为这 阅读全文

posted @ 2021-11-19 08:59 且行且思 阅读(5490) 评论(0) 推荐(0) 编辑

摘要:CMD 切换到MySQL安装目录Bin下: cd C:\Program Files\MySQL\MySQL Server 5.7\bin 输入:mysql -u root -p 继续输入密码 开放局域网连接:grant all privileges on *.* to root@'%' identi 阅读全文

posted @ 2021-08-05 08:56 且行且思 阅读(75) 评论(0) 推荐(0) 编辑

摘要:UPDATE orders LEFT JOIN freports ON freports.order_id = orders.id set orders.finish_at = freports.created_at where orders.id in(1,2,3) 阅读全文

posted @ 2021-01-14 11:10 且行且思 阅读(652) 评论(0) 推荐(0) 编辑

摘要:今天更新数据时出现这个错误: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed 原因是:我在service层设置了只读。@Transactional 阅读全文

posted @ 2020-11-25 15:26 且行且思 阅读(1654) 评论(0) 推荐(0) 编辑

摘要:准备工作:新建表tb_coupon /* Navicat Premium Data Transfer Source Server : root@localhost Source Server Type : MySQL Source Server Version : 50527 Source Host 阅读全文

posted @ 2020-06-15 08:25 且行且思 阅读(1118) 评论(0) 推荐(0) 编辑

摘要:一个字段可能对应多条数据,用mysql实现将多行数据合并成一行数据 例如:一个活动id(activeId)对应多个模块名(modelName),按照一般的sql语句: 1 SELECT am.activeId,m.modelName 2 FROM activemodel am 3 JOIN mode 阅读全文

posted @ 2020-05-15 11:52 且行且思 阅读(873) 评论(0) 推荐(0) 编辑

摘要:MySQL字符串的拼接、截取、替换、查找位置。常用的字符串函数:函数 说明CONCAT(s1,s2,...) 返回连接参数产生的字符串,一个或多个待拼接的内容,任意一个为NULL则返回值为NULL。CONCAT_WS(x,s1,s2,...) 返回多个字符串拼接之后的字符串,每个字符串之间有一个x。 阅读全文

posted @ 2020-05-15 11:50 且行且思 阅读(1093) 评论(0) 推荐(0) 编辑

摘要:SELECT TABLE_NAME,DATA_LENGTH,INDEX_LENGTH,(DATA_LENGTH+INDEX_LENGTH) as length,TABLE_ROWS,concat(round((DATA_LENGTH+INDEX_LENGTH)/1024/1024,3), 'MB') 阅读全文

posted @ 2020-03-20 17:34 且行且思 阅读(1726) 评论(0) 推荐(0) 编辑

摘要:在使用update语句的时候我们有时候需要利用left join 关联表,以下是正确操作: 效果,让指定的order表id为1,2,3数据的finish_at字段更新为freports表的created_at字段 UPDATE orders LEFT JOIN freports ON freport 阅读全文

posted @ 2020-03-20 14:13 且行且思 阅读(2853) 评论(0) 推荐(0) 编辑

摘要:方法一:正则表达式 select * from typg_house_tag where tht_num not REGEXP '(^[0-9]+.[0-9]+$)|(^[0-9]$)' 方法二:length()和char_length() select * from typg_house_tag 阅读全文

posted @ 2020-03-06 17:44 且行且思 阅读(3299) 评论(0) 推荐(0) 编辑

摘要:mysql查询出所有重复的记录 假如我们有如下一张数据表(很简单,只是举例而已),表名为student。现在我们要取出其中重复记录。重复是以name相同为判定标准。 ID name phone age 1 张三 10086 15 2 李四 10010 20 3 王五 10010 22 4 赵六 10 阅读全文

posted @ 2020-02-24 09:35 且行且思 阅读(1653) 评论(0) 推荐(0) 编辑

摘要:使用MySQL执行update的时候报错:Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disabl 阅读全文

posted @ 2019-10-25 09:50 且行且思 阅读(335) 评论(0) 推荐(0) 编辑

摘要:show variables like '%max_connections%'; 查看最大连接数 set global max_connections=1000 重新设置最大连接数 set-variable=max_user_connections=30 这个就是单用户的连接数set-variabl 阅读全文

posted @ 2019-10-22 08:30 且行且思 阅读(2287) 评论(0) 推荐(0) 编辑

摘要:select count(id),sum(Price) from [T_AddPrice] as a where (select sum(Price) from [T_AddPrice] as b where a.id<=b.id)<1000 --order by id 阅读全文

posted @ 2019-01-29 14:15 且行且思 阅读(1391) 评论(0) 推荐(0) 编辑

摘要:今天 select * from 表名 where to_days(时间字段名) = to_days(now()); 昨天 SELECT * FROM 表名 WHERE TO_DAYS( NOW( ) ) - TO_DAYS( 时间字段名) <= 1 近7天 SELECT * FROM 表名 whe 阅读全文

posted @ 2018-12-14 17:47 且行且思 阅读(3998) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示