提交 8be318fd 编写于 作者: M Mars Liu

log

上级 ea9b0488
{
"node_id": "mysql-4964024c989c4346861b67ae013d746c",
"keywords": [],
"keywords": [
"general log",
"查询日志"
],
"children": [],
"export": [],
"export": [
"general_log.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "Mars",
"source": "general_log.md",
"notebook_enable": false,
"exercise_id": "abca6ad634a74d09ba5cf44ab2510bfb"
}
\ No newline at end of file
# 查询日志
Joe 想要给 goods 数据库加上查询日志,将其保存到 `/data/log/mysql/goods/`。他需要执行下列哪些操作?
1. 执行shell命令 `mkdir -p /data/log/mysql/goods/`
2. 编辑 my.cnf 的 \[mysqld\]节,设置
```
general_log = 1
general_log_file = /data/log/mysql/goods/general_statement.log
log_output = FILE
```
3. 重启 MySQL 服务
4. 备份数据库
5. 恢复数据库
## 答案
```
1, 2, 3
```
## 选项
### A
```
1, 2, 3, 4, 5
```
### B
```
1, 2, 4, 5
```
### C
```
1, 2
```
\ No newline at end of file
{
"node_id": "mysql-6f74222f9e3d422c87b6b2dd30c2cc80",
"keywords": [],
"keywords": [
"slow log",
"慢查询日志"
],
"children": [],
"export": [],
"export": [
"slow_log.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "Mars",
"source": "slow_log.md",
"notebook_enable": false,
"exercise_id": "e627e414320f42aeaf0d41a8f6b7acb2"
}
\ No newline at end of file
# 慢查询日志
Joe 想要给 goods 数据库加上慢查询日志,将其保存到 `/data/log/mysql/goods/`。他需要执行下列哪些操作?
1. 执行shell命令 `mkdir -p /data/log/mysql/goods/`
2. 编辑 my.cnf 的 \[mysqld\]节,设置
```
slow_log = 1
slow_log_file = /data/log/mysql/goods/slow_statement.log
log_output = FILE
```
3. 重启 MySQL 服务
4. 备份数据库
5. 恢复数据库
## 答案
```
1, 2, 3
```
## 选项
### A
```
1, 2, 3, 4, 5
```
### B
```
1, 2, 4, 5
```
### C
```
1, 2
```
\ No newline at end of file
{
"node_id": "mysql-7645195ec078406c9303d39ea9c3738c",
"keywords": ["日志", "错误日志"],
"keywords": [
"日志",
"错误日志"
],
"children": [],
"export": [],
"export": [
"error_log.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 2
......
{
"type": "code_options",
"author": "Mars",
"source": "error_log.md",
"notebook_enable": false,
"exercise_id": "edcf45beef534a9db8e906bafb00166e"
}
\ No newline at end of file
# 错误日志
Joe 想要给 goods 数据库加上错误日志,将其保存到 `/data/log/mysql/goods/`。他需要执行下列哪些操作?
1. 执行shell命令 `mkdir -p /data/log/mysql/goods/`
2. 编辑 my.cnf 的 \[mysqld\]节,设置
```
log_error = /data/log/mysql/goods/slow_statement.log
```
3. 重启 MySQL 服务
4. 备份数据库
5. 恢复数据库
## 答案
```
1, 2, 3
```
## 选项
### A
```
1, 2, 3, 4, 5
```
### B
```
1, 2, 4, 5
```
### C
```
1, 2
```
\ No newline at end of file
{
"type": "code_options",
"author": "Mars",
"source": "binlog.md",
"notebook_enable": false,
"exercise_id": "4f3e0c57d21f41e59d312870ae7df3b3"
}
\ No newline at end of file
# 二进制日志
Joe 想要给 goods 数据库加上二进制日志,将其保存到 `/data/log/mysql/goods/binlog`。他需要执行下列哪些操作?
1. 执行shell命令 `mkdir -p /data/log/mysql/goods/binlog`
2. 编辑 my.cnf 的 \[mysqld\]节,设置
```
log_bin = /data/log/mysql/goods/binlog
binlog_format= mixed
binlog_cache_size=32m
max_binlog_cache_size=64m
max_binlog_size=512m
expire_logs_days = 10
```
3. 重启 MySQL 服务
4. 备份数据库
5. 恢复数据库
## 答案
```
1, 2, 3
```
## 选项
### A
```
1, 2, 3, 4, 5
```
### B
```
1, 2, 4, 5
```
### C
```
1, 2
```
\ No newline at end of file
{
"node_id": "mysql-ab25d57bc9704572bc3c54abb83b769b",
"keywords": ["binlog"],
"keywords": [
"binlog"
],
"children": [],
"export": [],
"export": [
"binlog.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
......@@ -3,5 +3,5 @@
"author": "Mars",
"source": "disaster_recovery.md",
"notebook_enable": false,
"exercise_id": "abca6ad634a74d09ba5cf44ab2510bfb"
"exercise_id": "2b7463f6dbc64d1c8fe6f983925eb4f1"
}
\ No newline at end of file
......@@ -1246,7 +1246,10 @@
{
"查询日志": {
"node_id": "mysql-4964024c989c4346861b67ae013d746c",
"keywords": [],
"keywords": [
"general log",
"查询日志"
],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
......@@ -1256,7 +1259,10 @@
{
"慢查询日志": {
"node_id": "mysql-6f74222f9e3d422c87b6b2dd30c2cc80",
"keywords": [],
"keywords": [
"slow log",
"慢查询日志"
],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册