随笔分类 - Mysql
摘要:在 MySQL 中,索引是一种数据结构,它能够帮助快速查找和检索表中的记录,从而提高查询性能。索引在数据库中类似于书籍的目录,可以快速定位到所需的内容。下面是关于 MySQL 索引的详细介绍,包括其概念、类型、如何使用以及如何在建表时指定索引。 什么是索引 索引是存储在数据库中的一种结构,用于加速数
阅读全文
摘要:_表示单个字符 SELECT * FROM employees WHERE first_name LIKE "___e%"; SELECT * FROM employees WHERE first_name LIKE "____"; 查询以J开头,a结尾 SELECT * FROM employee
阅读全文
摘要:查询当前连接数 mysql> SHOW STATUS LIKE 'Threads_connected'; + + + | Variable_name | Value | + + + | Threads_connected | 547 | + + + 要查询MySQL数据库的超时时间设置,你可以执行以
阅读全文
摘要:在 MySQL 8.0 中,可以使用以下命令查看当前数据库系统的时区设置: SELECT @@global.time_zone; 该命令将返回一个字符串,表示当前数据库系统的时区设置。例如,返回如下结果: + + | @@global.time_zone | + + | SYSTEM | + + 其
阅读全文
摘要:基于8.x版本 安装插件 mysql> install plugin CONNECTION_CONTROL soname 'connection_control.so'; Query OK, 0 rows affected (0.01 sec) mysql> install plugin CONNE
阅读全文
摘要:单行函数: 输入一行,输出一行聚合函数(分组函数): 输入多行,输出一行 单行函数: 输入一行,输出一行 聚合函数(分组函数): 输入多行,输出一行 #1.数值函数 #基本的操作 SELECT ABS(-123),ABS(32),SIGN(-23),SIGN(43),PI(),CEIL(32.32)
阅读全文
摘要:SQL Server 2019下载及安装详细教程:https://blog.csdn.net/m0_67401920/article/details/125244748?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-
阅读全文
摘要:今天mysql看磁盘空间不足,排查出来general_log.csv占了800G 1. 功能如下: 开启general_log,会将所有到达Mysql Server的SQL语句记录。 一般不会开启开功能,因为log的量会非常庞大。 但个别情况下可能会临时的开一会儿general log以供排障使用。
阅读全文
摘要:1、mysql查看binlog mysql> show binlog events; #只查看第一个binlog文件的内容 mysql> show binlog events ``in 'mysql-bin.000002'``;#查看指定binlog文件的内容 mysql> show binary
阅读全文
摘要:mysql> select version(); + + | version() | + + | 8.0.22 | + + 1 row in set (0.01 sec) mysql> show variables like '%expire%'; + + + | Variable_name | V
阅读全文
摘要:# 第06章_多表查询 /* SELECT ...,....,.... FROM .... WHERE .... AND / OR / NOT.... ORDER BY .... (ASC/DESC),....,... LIMIT ...,... */ #1. 熟悉常见的几个表 DESC emplo
阅读全文
摘要:#第05章_排序与分页 #1. 排序 # 如果没有使用排序操作,默认情况下查询返回的数据是按照添加数据的顺序显示的。 SELECT * FROM employees; # 1.1 基本使用 # 使用 ORDER BY 对查询到的数据进行排序操作。 # 升序:ASC (ascend) 默认方式 # 降
阅读全文
摘要:查询 去重 SELECT DISTINCT department_id FROM employees; 空值参数运算 如果值为null则使用0替换,任何值与null计算都为null SELECT employee_id,salary "月工资",salary * (1 + IFNULL(commis
阅读全文
摘要:采用rpm包安装 下载地址:https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-8.0-community-el7-x86_64/ 安装 yum -y install mysql-community-* 创建目录并修改权限 mkdir /data
阅读全文
摘要:参考文档:https://blog.csdn.net/milkbrother1988/article/details/103540583 打开解压后的文件夹,新建一个data文件夹和一个my.ini文件 [mysqld] port=3306 basedir=D:\mysql8 datadir=D:\
阅读全文
摘要:线上启动服务,发现过一会就自动失败退出,然后查看了一下日志 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysJobServiceImpl': I
阅读全文
摘要:1. 在mysqld 配置项添加 skip-grant-tables 2. 重启mysqld 3. 将root密码置空 mysql> update user set authentication_string='' where user='root'; 4. 退出,注释掉skip-grant-tab
阅读全文
摘要:https://www.cnblogs.com/kevingrace/p/10228694.html
阅读全文
摘要:故障截图 解决办法 vim /usr/lib/systemd/system/mariadb.service #在[service]下面加 [Service] LimitNOFILE=infinity 验证 systemctl daemon-reload systemctl restart maria
阅读全文