提交 1b5a3d67 编写于 作者: M Mars Liu

初阶

上级 0d288e2e
{
"node_id": "mysql-343463029f6d41068885687f4dd8bfbd",
"keywords": ["命令行", "mysql"],
"keywords": [
"命令行",
"mysql"
],
"children": [],
"export": [],
"export": [
"remote.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "remote.md",
"notebook_enable": false,
"exercise_id": "4e55553e2af44e29896cad771e3a72f4"
}
\ No newline at end of file
# 登录远程服务器
Joe 需要登录团队的开发服务器上的goods数据库,这台服务器地址是 10.123.45.17 ,MySQL 端口是 3306 。用户名是 joe,口令是 ixhewui 。
那么 Joe 需要如何操作?
## 答案
在终端输入
```shell
mysql -h 10.123.45.17 -p -ujoe goods
```
出现口令输入提示时输入口令。
## 选项
### A
在终端输入
```shell
mysql -h 10.123.45.17 -p3306 -ujoe goods
```
出现口令输入提示时输入口令。
### B
在终端输入
```shell
mysql -ujoe 10.123.45.17/goods
```
出现口令输入提示时输入口令。
### C
在终端输入
```shell
mysql mysql://joe@10.123.45.17/goods
```
出现口令输入提示时输入口令。
### D
在终端输入
```shell
mysql tcp://joe@10.123.45.17:3306/goods
```
出现口令输入提示时输入口令。
{
"node_id": "mysql-daca74b56aca48cea2da14078b518051",
"keywords": [],
"keywords": [
"mysqladmin",
"shell"
],
"children": [],
"export": [],
"export": [
"mysqladmin.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "mysqladmin.md",
"notebook_enable": false,
"exercise_id": "bf041da5e8df4d4a9e97820f4a23c5b9"
}
\ No newline at end of file
# MySQLAdmin
关于 MySQLAdmin,以下说法正确的是:
1. 可以用类似 mysql 命令行的参数配置需要连接的服务器
2. 可以在 `/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf` 中的某一个配置文件中配置连接选项,MySQLAdmin
会按顺序加载,重复项则后面的覆盖前面的。
3. MySQLAdmin 可以在 Shell 脚本中执行命令来完成一些数据库维护工作。
4. mysqladmin ping 命令可以检查服务器的运行状态
5. mysqladmin mount 命令可以将存储设备挂载到 MySQL 服务。
## 答案
```
1, 2, 3, 4
```
### A
```
1, 2, 3
```
### B
```
2, 3, 4
```
### C
所有都对
### D
```
3, 4, 5
```
\ No newline at end of file
{
"node_id": "mysql-b34e3244a8ba4166bd22bc4fe5f7d8db",
"keywords": [],
"keywords": ["myisampack", "myisam", "pack"],
"children": [],
"export": [],
"export": [
"myisampack.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "myisampack.md",
"notebook_enable": false,
"exercise_id": "c4f6829d45504651b142f9fc818e5626"
}
\ No newline at end of file
# MyISAMPack
关于 myisampack ,下列说法哪些是正确的?
1. myisampack命令用来压缩MyISAM数据表
2. 压缩后的数据表比原数据表占用更少的磁盘空间
3. 压缩后的数据表为只读数据表,不能对压缩后的数据表中的数据进行插入、更新和删除操作
4. 压缩后的数据表文件体积缩小,写入速度更快
5. 经过压缩的 MyISAM 表可以支持事务
## 答案
```
1, 2, 3
```
## 选项
### A
所有都对
### B
所有都不对
### C
```
1, 3, 5
```
### D
```
1, 3, 4
```
### E
```
2, 3, 5
```
{
"node_id": "mysql-fe9caf0e07a94efc8b7c8f2a4c683efe",
"keywords": [],
"keywords": ["mysqlbinlog", "binlog", "二进制日志"],
"children": [],
"export": [],
"export": [
"mysqlbinlog.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "mysqlbinlog.md",
"notebook_enable": false,
"exercise_id": "59fd8961fefa49f092ae49baa5ce3c89"
}
\ No newline at end of file
# MySQLBinlog
关于 mysqlbinlog ,以下说法正确的是:
1. mysqlbinlog 命令行采用和 mysql 命令行一致的连接参数登录服务器,并通过 --read-from-remote-server 读取远程服务器
2. mysqlbinlog 命令行通过命令行参数设定分析的目标文件
3. 可以指定 -o 参数设定忽略前 n 条操作记录
4. 可以通过 --start-datetime 和 --stop-datetime 指定要分析的时间段
5. 可以通过 --start-position 和 --stop-position 指定要分析的操作序列的范围
## 答案
全都正确
## 选项
### A
```
1, 2, 3, 4
```
### B
全都错误
### C
```
1,2, 4
```
### D
```
2, 3, 5
```
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "mysql-a4998d140f024982989ed4647c78ba65",
"keywords": [],
"children": [],
"export": [],
"export": [
"mysqldump.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "mysqldump.md",
"notebook_enable": false,
"exercise_id": "b10af2331df547ae93091af219a5e218"
}
\ No newline at end of file
# MySQLDump
关于 mysqldump 工具,以下说法正确的是
1. mysqldump 使用与 mysql 命令行一致的参数选项,设定要连接的 MySQL 服务器
2. 可以在 `/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf` 中的某一个配置文件中配置连接选项,MySQLDump
会按顺序加载,重复项则后面的覆盖前面的。
3. mysqldump 默认输出内容到终端,可以通过管道重定向到文件
4. 可以通过 -r 或 --result-file 指定输出的文件
5. 设定 --no-data 可以只导出数据结构,不包括数据
6. 设定 --no-create-info 可以只导出数据
7. --databases 选项可以指定仅导出哪些数据库
8. --tables 选项可以指定仅导出哪些表(覆盖 databases)
## 答案
以上都对
### 选项
### A
```
1, 2, 3
```
### B
```
1, 2, 3, 4
```
### C
```
1, 2, 3, 4, 5
```
### D
```
2, 3, 4, 5
```
### E
```
1
```
### F
```
2, 4, 6
```
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "mysql-d9cdafd993bf41bbb860e5087dd54bd1",
"keywords": [],
"children": [],
"export": [],
"export": [
"mysqlcheck.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "mysqlcheck.md",
"notebook_enable": false,
"exercise_id": "2dececb9b3734e92951b9e1272ee2013"
}
\ No newline at end of file
# MySQLCheck
关于 mysqlcheck 命令行,以下说法正确的是:
1. mysqlcheck命令主要用来维护数据库中MyISAM存储引擎的数据表
2. 可以在 `/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf` 中的某一个配置文件中配置连接选项,MySQLCheck
会按顺序加载,重复项则后面的覆盖前面的。
3. 指定 -c 选项检查错误
4. 指定 -a 或 --analyze 则仅检查给定的表
5. 指定 -r 选项则进行修复操作
## 答案
全部都对
## 选项
### A
```
1, 2, 3
```
### B
```
4, 5
```
### C
```
1, 3, 5
```
### D
```
2, 3, 4, 5
```
### E
```
2, 3, 5
```
### F
``
全都不对
``
\ No newline at end of file
......@@ -2,7 +2,9 @@
"node_id": "mysql-430b0de67c294d64aff35c85fec8393e",
"keywords": [],
"children": [],
"export": [],
"export": [
"mysqlshow.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "mysqlshow.md",
"notebook_enable": false,
"exercise_id": "34b4ef9779ec4929b71b9b168792b34f"
}
\ No newline at end of file
# MySQLShow
关于 mysqlshow 工具,以下说法正确的是:
1. mysqlshow命令主要用来查看MySQL中存在的数据库和数据表,以及数据表中的字段和索引等信息
2. 可以在 `/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf` 中的某一个配置文件中配置连接选项,MySQLShow
会按顺序加载,重复项则后面的覆盖前面的。
3. --count 选项可以查看各数据库中表的数量和数据行数
4. 传入数据库命可以查看指定数据库的各表行数和列数
5. 传入库名和表名可以查看指定数据表的列数和行数
6. 指定 -k 选项可以查看索引的信息
## 答案
全部都对
## 选项
### A
```
1, 2, 3
```
### B
```
4, 5, 6
```
### C
```
1, 3, 5
```
### D
```
2, 3, 4, 5
```
### E
```
2, 3, 5, 6
```
### F
``
全都不对
``
......@@ -2,7 +2,9 @@
"node_id": "mysql-c5b92946b8824ceea97b20f26946bb76",
"keywords": [],
"children": [],
"export": [],
"export": [
"mysqlpump.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "mysqlpump.md",
"notebook_enable": false,
"exercise_id": "5c890185eb2742aa92ac8a8f303d7cec"
}
\ No newline at end of file
# MySQLDump
关于 mysqlpump 工具,以下说法正确的是
1. mysqldump 使用与 mysql 命令行一致的参数选项,设定要连接的 MySQL 服务器
2. 可以在 `/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf` 中的某一个配置文件中配置连接选项,MySQLPump
会按顺序加载,重复项则后面的覆盖前面的。
3. mysqlpump备份数据时支持并行处理、备份用户和压缩备份文件等功能
4. mysqldump支持在备份数据时,可以为指定的数据库分配不同的线程数进行备份
5. 通过 --include-databases 选项,可以对部分数据库进行备份。
6. 通过 --exclude-databases 选项,可以排除部分数据库
## 答案
以上都对
### 选项
### A
```
1, 2, 3
```
### B
```
1, 2, 3, 4
```
### C
```
1, 2, 3, 4, 5
```
### D
```
2, 3, 4, 5
```
### E
```
1
```
### F
```
2, 4, 6
```
\ No newline at end of file
{
"node_id": "mysql-e782e10839d843c0ad36a05ae7d0366f",
"keywords": [],
"keywords": [
"mysqlimport",
"import",
"restore",
"导入"
],
"children": [],
"export": [],
"export": [
"mysqlimport.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "mysqlimport.md",
"notebook_enable": false,
"exercise_id": "1d0491c9515644ef8edc4fbd0abe8a8d"
}
\ No newline at end of file
# MySQLDump
关于 mysqlimport 工具,以下说法正确的是
1. mysqlimport 使用与 mysql 命令行一致的参数选项,设定要连接的 MySQL 服务器
2. 可以在 `/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf` 中的某一个配置文件中配置连接选项,MySQLImport
会按顺序加载,重复项则后面的覆盖前面的。
3. mysqlimport 通过 -T 参数将 mysqldump 导出的文件导入到数据库
4. 指定 -c 或 --columns 可以指定需要导入的字段
5. 指定 -d 或 --delete 会先删除既有的数据再导入
6. 指定 -i 或 --ignore,遇到主键冲突时,忽略这一行
## 答案
以上都对
### 选项
### A
```
1, 2, 3
```
### B
```
1, 2, 3, 4
```
### C
```
1, 2, 3, 4, 5
```
### D
```
2, 3, 4, 5
```
### E
```
1
```
### F
```
2, 4, 6
```
\ No newline at end of file
......@@ -348,7 +348,7 @@
}
},
{
"mysqldump": {
"mysqlpump": {
"node_id": "mysql-c5b92946b8824ceea97b20f26946bb76",
"keywords": [],
"children": [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册