django安装了pymysql还报MySQLdb module: No module named

  • Post author:
  • Post category:mysql

转载: https://blog.51cto.com/853056088/2295576 在 python2 中,使用 pip install mysql-python 进行安装连接MySQL的库,使用时 import MySQLdb 进行使用 在 python3 中,改变了连接库,改为了 pymysql 库,使用pip install pymysql 进行安装,直接导入即可使用 但是在 Djan…

继续阅读 django安装了pymysql还报MySQLdb module: No module named

mybatis-plus实现mysql自定义IKeyGenerator

  • Post author:
  • Post category:mysql

1. IKeyGenerator主键生成 内置实现类,缺少mysql,因为mysql不支持序列,只能通过表模拟序列 H2KeyGenerator PostgreKeyGenerator KingbaseKeyGenerator 人大金仓的KES数据库 DB2KeyGenerator OracleKeyGenerator 2. 新建表模拟序列 CREATE TABLE `dual_sequence`…

继续阅读 mybatis-plus实现mysql自定义IKeyGenerator

mysql配置

  • Post author:
  • Post category:mysql

ProxySQL实现MySQL读写分离 官方站点:https://proxysql.com/ 官方手册:https://github.com/sysown/proxysql/wiki proxysql安装 基于YUM仓库安装 cat <<EOF | tee /etc/yum.repos.d/proxysql.repo [proxysql_repo] name= ProxySQL YUM…

继续阅读 mysql配置

mysql 连接查询

  • Post author:
  • Post category:mysql

数据准备 学生表(字段:主键ID、学生编号、科目编号、学生姓名) create table if not exists `students_test` ( `id` int(11) not null auto_increment, `stuid` int(11) not null, `subid` int(11) default null, `stuname` varchar(50) not nu…

继续阅读 mysql 连接查询

mysql查询sum和case where的用法

  • Post author:
  • Post category:mysql

1、统计表中每个部门的男生,女生各多少人 select deptid as 部门id, sum(case sex when '男' then 1 else 0 end) as 男生人数, sum(case sex when '女' then 1 else 0 end) as 女生人数 from hrmresource GROUP BY deptid 2、查询出人数最多的部门id select de…

继续阅读 mysql查询sum和case where的用法

mysql中的row_number() over()

  • Post author:
  • Post category:mysql

链接在此 版权声明:本文为qq_45292079原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.csdn.net/qq_45292079/article/details/105783797

继续阅读 mysql中的row_number() over()

MySQL中创建数据库并添加表

  • Post author:
  • Post category:mysql

1、创建名为(db_mingzhu)的数据库并进行查看 2、切换到(db_mingzhu)数据库, 3、在(db_mingzhu)数据库中创建表(由于表达数据类型有错误,第二张截图是修改author列类型) <1>t_sanguo <2>t_shuihuo <3>t_honglou <4>t_xiyou 4、插入数据(新创建一个表) 版权声明:本文为…

继续阅读 MySQL中创建数据库并添加表

Centos8安装MySQL8.0,基于rpm安装

  • Post author:
  • Post category:mysql

步骤一:下载rpm安装包 文章已迁移: 详细内容点击这里 wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm 步骤二:安装rpm包 yum install mysql80-community-release-el8-1.noarch.rpm 步骤三:禁用CentOS8自带mysql模块 步骤四:安装My…

继续阅读 Centos8安装MySQL8.0,基于rpm安装

mysql的时间存储

  • Post author:
  • Post category:mysql

背景:在某次创建活动时,设置活动的有效期(数据库表的字段是 TIMESTAMP类型 ),代码中设置过期时间为当前时间的之后30年。存储时报错。 ###Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value : '2048-04-09 20:03:15.486' for column '…

继续阅读 mysql的时间存储

mysql匹配汉字字符

  • Post author:
  • Post category:mysql

示例SQL代码如下: select username from user where not(username regexp "[\u0391-\uFFE5]"); 这个正则表达式就能判断出来了。

继续阅读 mysql匹配汉字字符