随笔分类 -  mysql

摘要:SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.tables GROUP BY tabl 阅读全文
posted @ 2025-11-06 18:34 刚好遇见Mysql 阅读(9) 评论(0) 推荐(0)
摘要:SELECT ( SELECT variable_value FROM PERFORMANCE_SCHEMA.global_status WHERE variable_name = 'Innodb_buffer_pool_read_requests' ) / ( SELECT SUM( variab 阅读全文
posted @ 2025-07-25 10:49 刚好遇见Mysql 阅读(13) 评论(0) 推荐(0)
摘要:create index idx_fa_ledger_h_001 on fiefa.fa_ledger_h(accentity_id,accbook_id,asset_code); analyze table iuap_apdoc_basedoc.bd_staffALTER table fiefa. 阅读全文
posted @ 2025-07-24 16:33 刚好遇见Mysql 阅读(10) 评论(0) 推荐(0)
摘要:开启或关闭并行查询开启并行查询SELECT /*+PARALLEL(x)*/ ... FROM ...; SELECT /*+ SET_VAR(max_parallel_degree=n) */ * FROM ... 关闭并行查询SELECT /*+NO_PARALLEL()*/ ... FROM 阅读全文
posted @ 2025-07-22 14:42 刚好遇见Mysql 阅读(62) 评论(0) 推荐(0)
摘要:# 查看mysql允许的最大连接数show variables like '%max_connections%' ;# 查看mysql已使用的连接数show global status like'Max_used_connections';# 修改mysql允许的最大连接数set GLOBAL ma 阅读全文
posted @ 2025-07-08 17:28 刚好遇见Mysql 阅读(21) 评论(0) 推荐(0)
摘要:中继日志(relaylog)只在主从服务器架构的从服务器上存在。从服务器(slave)为了与主服务器(Master)保持一致,要从主服务器读取二进制日志的内容,并且把读取到的信息写入本地的日志文件中,这个从服务器本地的日志文件就叫中继日志。从服务器读取中继日志,并根据中继日志的内容对从服务器的数据进 阅读全文
posted @ 2024-08-05 10:29 刚好遇见Mysql 阅读(163) 评论(0) 推荐(0)
摘要:mysql日志时间默认格式查询 mysql> SHOW GLOBAL VARIABLES LIKE 'log_timestamps';+ + +| Variable_name | Value |+ + +| log_timestamps | UTC |+ + +1 row in set (0.08 阅读全文
posted @ 2024-08-03 09:37 刚好遇见Mysql 阅读(74) 评论(0) 推荐(0)
摘要:备份 /usr/bin/xtrabackup --defaults-file=/etc/my.cnf --no-server-version-check --user=bk --password=ocm123 --backup --target-dir=/data/bk/bk_`date +%Y%m 阅读全文
posted @ 2024-08-02 11:54 刚好遇见Mysql 阅读(146) 评论(0) 推荐(0)
摘要:查看密码策略 mysql> SHOW VARIABLES LIKE 'validate_password%'; + + + | Variable_name | Value | + + + | validate_password_check_user_name | ON | | validate_pa 阅读全文
posted @ 2024-08-02 08:49 刚好遇见Mysql 阅读(28) 评论(0) 推荐(0)
摘要:mysql> optimize table iuap_apdoc_coredoc.productapplyrange;+ + + + +| Table | Op | Msg_type | Msg_text |+ + + + +| iuap_apdoc_coredoc.productapplyrang 阅读全文
posted @ 2024-07-30 14:57 刚好遇见Mysql 阅读(44) 评论(0) 推荐(0)
摘要:--正在执行语句 select a.thd_id,a.db,a.time,a.current_statement,a.full_scan,a.current_memory,a.statement_latency from sys.session a WHERE conn_id!=connection 阅读全文
posted @ 2024-07-29 14:30 刚好遇见Mysql 阅读(40) 评论(0) 推荐(0)
摘要:##计算shmall和shmmax值memTotal=$(grep MemTotal /proc/meminfo | awk '{print $2}')totalMemory=$((memTotal / 2048))shmall=$((memTotal / 4))if [ $shmall -lt 2 阅读全文
posted @ 2024-07-26 09:49 刚好遇见Mysql 阅读(28) 评论(0) 推荐(0)
摘要:升级前备份见 https://www.cnblogs.com/omsql/p/9241366.html ln -s mysql-8.0.33-linux-glibc2.12-x86_64 mysql MySQL8.0.16开始,MySQL 不推荐使用mysql_upgrade;直接使用 mysqld 阅读全文
posted @ 2024-07-26 06:52 刚好遇见Mysql 阅读(112) 评论(0) 推荐(0)
摘要:-- 查看自动清理,过期天数 mysql> show variables like 'expire_logs_days';+ + +| Variable_name | Value |+ + +| expire_logs_days | 5 |+ + + -- 查看日志 show master logs 阅读全文
posted @ 2023-03-20 10:05 刚好遇见Mysql 阅读(49) 评论(0) 推荐(0)
摘要:/etc/init.d/mysql start Starting MySQL (Percona XtraDB Cluster)....................................................................................... 阅读全文
posted @ 2022-09-07 10:06 刚好遇见Mysql 阅读(154) 评论(0) 推荐(0)
摘要:mysql> show variables like "%general_log%"; + + + | Variable_name | Value | + + + | general_log | OFF | | general_log_file | /data/mysql/mysql01.log | 阅读全文
posted @ 2022-09-07 09:52 刚好遇见Mysql 阅读(448) 评论(0) 推荐(0)
摘要:--全备备份:innobackupex --user=DBUSER --password=DBUSERPASS --defaults-file=/etc/my.cnf /backups/ 恢复:innobackupex --apply-log /backups/2018-07-30_11-04-55 阅读全文
posted @ 2022-08-11 16:02 刚好遇见Mysql 阅读(46) 评论(0) 推荐(0)
摘要:wget --content-disposition https://packagecloud.io/akopytov/sysbench/packages/el/6/sysbench-1.0.19-1.el6.x86_64.rpm/download.rpm rpm -ivh sysbench-1.0 阅读全文
posted @ 2020-01-07 12:27 刚好遇见Mysql 阅读(478) 评论(0) 推荐(0)
摘要:mysql> select emp_no,first_name,last_name,gender into outfile '/home/mycat/t1.txt' -> FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMIN 阅读全文
posted @ 2019-05-30 14:16 刚好遇见Mysql 阅读(661) 评论(0) 推荐(0)
摘要:下载 wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz 创建用户和组及变更权限 groupadd mysqluseradd mysql -g mysql pass 阅读全文
posted @ 2019-05-27 17:03 刚好遇见Mysql 阅读(703) 评论(0) 推荐(0)