![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
会吐泡泡的小鱼儿
用简单明了的图文记录问题的解决方案!
展开
-
MySQL 数据量大 分页查询慢调优方案
多张表联合查询,分页时,查询慢解决方案两张表联合查询,表1数据量7.5万,表2数据量400,联合查询时,当查询尾页的时候,查询时间是第一页的千倍注意:本方案不考虑排序问题最初的做法select * from goods as gleft join goods_class as c on c.class_code = g.class_code limit 0, 10调整后的方案select * from goods as gleft join goods_class as c on原创 2020-12-17 18:28:49 · 748 阅读 · 0 评论 -
mysql联合查询慢的优化方案及卡的问题排查
explainselect count(base.code)from order_base_info as baseinner join order_logistics_info as logisticsInfo on logisticsInfo.order_code = base.codeleft join order_logistics_cost_info as costInfo on costInfo.order_code = base.codewhere base.logistics_st原创 2020-11-23 23:27:50 · 745 阅读 · 0 评论 -
MySQL常用小列子
一、指定字符串排序 ORDER BY FIELD(status, 2, 1, 3)原创 2020-08-25 11:00:03 · 131 阅读 · 0 评论 -
MySQL查询表创建的时间
查看指定表的创建时间,记得在多人开发中及时更新自己的数据库信息。SELECT table_name,create_time FROM information_schema.TABLES WHERE table_name='student';原创 2020-04-26 09:32:24 · 852 阅读 · 0 评论 -
Linux7 mysql5.7安装步骤及远程访问工具SQLyog
Linux mysql5.7资源包:https://pan.baidu.com/s/1Yc9S8Ybv9fCifF73bS3hyA此处Linux相关操作省略,如有需要可参考本人相关博客。安装mysql5.7步骤: 1. 上传资源到Linux系统的/usr/local/文件夹里; 2. 使用tar -zxvf 命令解压刚上传的mysql压缩包; ...原创 2020-03-29 13:22:35 · 334 阅读 · 1 评论 -
MySQL中添加数据时,同时生成UUID
code是product表中的主键,使用UUID保持唯一性,insert into product(code, productNum, productName) values(REPLACE(UUID(), '-', ''), 001, '计算机')原创 2020-02-27 18:08:05 · 2969 阅读 · 0 评论 -
访问数据库是报c3p0相关的错误:Method com/mchange/v2/c3p0/impl/NewProxyPreparedStatement.isClosed()Z is abstract
出现下图中的问题:使用了不恰当的依赖<dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version> <type>jar</type>...原创 2020-02-26 20:48:36 · 217 阅读 · 0 评论 -
Mysql5.1导入sql文件时报错your MySQL server version for the right syntax to use near 'USING BTREE,
SQL语句:在导入Mysql5.1时的报错信息[42000][1064] 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 'USING BTREE,UNIQUE KEY `...原创 2019-04-24 16:27:23 · 3514 阅读 · 0 评论 -
MySQLDataException: '1.43350049529E12' in column '1' is outside valid range for the datatype INTEGER
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '1.43350049529E12' in column '1' is outside valid range for the datatype INTEGER.通过console中的运行日志信息可以看到,我的这个code是一个Integer类型,但是现在有值超出...原创 2019-04-28 20:22:26 · 3260 阅读 · 0 评论 -
删除MySQL数据表中的重复数据,并保留一份重复数据
再用python进行数据爬取的时候,把需要的字段值存入MySQL数据库,却出现了重复数据,在解决这一问题的时候遇到的坑。在此记录一下,备忘。数据资源:链接:https://pan.baidu.com/s/14VUd5ftpUXrAz-Ka5UXk4w 提取码:gry1 错误SQL语句:deletefrom maoyanwhere id in( select ...原创 2019-01-16 22:07:45 · 500 阅读 · 0 评论 -
MySQL数据库修改默认的字符集
找到MySQL的安装目录找到my.ini配置文件,修改default-character-set的值为指定的字符编码,如utf8即可完成数据库安装时未设置目标字符集导致的乱码问题。原创 2018-09-07 15:13:36 · 4299 阅读 · 2 评论 -
Python2.7 连接MySQL数据库
本人操作系统为win10,python安装版本为2.7,数据库使用的MySQL5.0在使用python连接MySQL数据库是遇到的资源库问题、在GitHub上找到了解决方案https://github.com/PyMySQL/PyMySQL/tree/master/pymysql,在此记录一下。下图的问题信息,看似是下载成功了,却告诉我说缺少C++资源库。正确的方式是:pip inst...原创 2019-01-15 17:41:31 · 7999 阅读 · 0 评论