0%

引言

MySQL的账号由 '用户名'@'主机或IP' 构成,当用户连接匹配到mysql权限表中不同账号时,将被赋予对应的权限

1
mysql> select user,host from mysql.user;
2
+---------------+-----------+
3
| user          | host      |
4
+---------------+-----------+
5
|               |           |
6
| test          |           |
7
|               | %         |
8
| test          | %         |
9
| mysql.session | localhost |
10
| mysql.sys     | localhost |
11
| root          | localhost |
12
|               | node1     |
13
| test          | node1     |
14
+---------------+-----------+
15
9 rows in set (0.00 sec)
阅读全文 »

概述

在之前的版本中,MySQL已经把Nested Loop玩出了诸多花样(除普通NL外,还有BNL和BKA)。随着MySQL 8.0中统计直方图的完善,hash join终于出现在了MySQL 8.0.18版本中,用于替代性能较差的BNL。

阅读全文 »

参数说明

open_files_limit参数限制了mysqld进程能够打开的操作系统文件描述符(fd)的最大数量,如果没有显式设置这个参数值,它的默认值取如下四种值中的最大值(版本>=5.6.8):

  1. 10 + max_connections + (table_open_cache * 2)
  2. max_connections * 5
  3. 操作系统设置的open files的上限值(启动mysqld的操作系统用户的ulimit -n)
  4. 5000
阅读全文 »

mysqld的内存使用策略

mysqld启动前状态:OS总内存1985MB,已使用280MB,空闲941MB,Swap空间未使用

1
[root@bogon ~]# ps -ef | grep mysqld
2
root      69294  68350  0 09:35 pts/0    00:00:00 grep mysqld
3
[root@bogon ~]# free -m
4
              total        used        free      shared  buff/cache   available
5
Mem:           1985         280         941           8         763        1543
6
Swap:          2047           0        2047
阅读全文 »