2023/10/30

查看mysql所有库的大小

SELECT table_schema AS 'Database', CONCAT(ROUND(SUM(data_length + index_length) / 1024 / 1024, 2), 'MB') AS 'Size' FROM information_schema.tables WHERE tab…

  • mysql
  • 2023/10/30
  • 582
  • 2023/4/20

    nginx 代理内网mysql

    nginx主配置文件最外层增加如下配置 #mysql代理 stream { log_format proxy '$remote_addr [$time_local] ' '$protocol $status $bytes_sent $bytes_received ' …

  • mysql nginx
  • 2023/4/20
  • 628
  • 2022/11/3

    mysql 将两个只有一行结果的select 合并到一行返回

    select AA.* , BB.* from (select count(id) from wl_pc_driver) as AA , (select count(id) from wl_pc_driver) as BB

  • mysql
  • 2022/11/3
  • 702
  • 2022/8/26

    mysql定义存储过程,根据select查询出来的结果循环修改数据

    -- 创建存储过程之前需判断该存储过程是否已存在,若存在则删除 DROP PROCEDURE IF EXISTS init_reportUrl; -- 创建存储过程 CREATE PROCEDURE init_reportUrl() BEGIN -- 定义变量 DECLARE s int DEFAULT…

  • mysql 存储过程
  • 2022/8/26
  • 745
  • 2022/7/4

    mysql general_log

    show variables like 'general_log';  -- 查看日志是否开启 show variables like 'log_output';  -- 看看日志输出类型  table或file show variables like 'general_log_file…

  • mysql
  • 2022/7/4
  • 711
  • 2022/6/23

    mysql将两个select合并一行

    SELECT (SELECT sum(driver_salary) from hydd_taizhang) ss , (SELECT SUM(dt_salary)+SUM(ct_salary) FROM hydd_order) sss

  • mysql
  • 2022/6/23
  • 732
  • 2022/4/27

    mysql 查询所有表

    select concat('truncate table ', table_name, ';') from information_schema.tables where table_schema ="yzhr" and table_name like 'act_%';

  • mysql
  • 2022/4/27
  • 759