Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

Netkiller Database 手札

PostgreSQL, MariaDB, MySQL, Oracle, Redis, MongoDB, Elasticsearch ...

Mr. Neo Chan, 陈景峯(BG7NYT)



中国广东省深圳市望海路半岛城邦三期
518067
+86 13113668890


文档初创于April 6, 2008

电子书最近一次更新于 2026-03-27 13:59:02

版权声明

转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。

http://www.netkiller.cn
http://netkiller.github.io
http://netkiller.sourceforge.net
微信公众号: netkiller
微信:13113668890 请注明“读者”
QQ:13721218 请注明“读者”
QQ群:128659835 请注明“读者”
知乎专栏

$Date: 2013-05-21 19:01:33 +0800 (Tue, 21 May 2013) $


致读者

Netkiller 系列手札 已经被 Github 收录,并备份保存在北极地下250米深的代码库中,备份会保留1000年。

Preserving open source software for future generations

The world is powered by open source software. It is a hidden cornerstone of modern civilization, and the shared heritage of all humanity.

The GitHub Arctic Code Vault is a data repository preserved in the Arctic World Archive (AWA), a very-long-term archival facility 250 meters deep in the permafrost of an Arctic mountain.

We are collaborating with the Bodleian Library in Oxford, the Bibliotheca Alexandrina in Egypt, and Stanford Libraries in California to store copies of 17,000 of GitHub’s most popular and most-depended-upon projects—open source’s “greatest hits”—in their archives, in museum-quality cases, to preserve them for future generations.

https://archiveprogram.github.com/arctic-vault/

目录

1. 自述
1.1. 写给读者
1.2. 作者简介
1.3. 如何获得文档
1.4. 打赏(Donations)
1.5. 联系方式
I. Database Relational
1. DB-Engines - DB-Engines Ranking
2. SysBench
3. SuperSmack
4. ETL (Extract-Transform-Load)
4.1. Kettle
4.1.1. 安装
4.2. suro
5. 数据迁移
5.1. Apache Sqoop
6. GreenSQL
7. Database design & E-R diagram
7.1. opensource database design tools
7.2. OpenSystemArchitect
7.3. SQL Power Architect
II. Search Engine
8. Meilisearch
8.1. 安装
9. Elasticsearch
9.1. 安装 Elasticsearch
9.1.1. Docker 8.8.1
9.1.2. IK 分词
9.1.3. Helm Chart 安装 Elasticsearch
9.1.4. Elastic Cloud on Kubernetes
9.1.5. docker-compose 安装
9.1.6. Kubernetes
9.1.7. netkiller-devops 编排 elasticsearch
9.1.8. 安装指定版本的 Elasticsearch
9.1.9. Plugin
9.1.10. netkiller-devops 编排 Kubernetes
9.2. 文档API
9.2.1. 快速上手
9.2.2. 写入 PUT/POST
9.2.3. 获取 GET
9.2.4. 检查记录是否存在
9.2.5. 删除 Delete
9.2.6. 参数
9.3. 搜索
9.3.1. URL 搜索
9.3.2. 分页
9.4. Query DSL
9.4.1. match 匹配
9.4.2. multi_match 多字段匹配
9.4.3. Query bool 布尔条件
9.4.4. filter 过滤
9.4.5. sort 排序
9.4.6. _source
9.4.7. highlight 高亮处理
9.5. 集群管理
9.5.1. 节点健康状态
9.5.2. 节点http状态
9.5.3. 查看master节点
9.5.4. 查看索引的节点分布
9.5.5. 索引的开启与关闭
9.6. 中文分词插件管理
9.6.1. 通过 elasticsearch-plugin 命令安装分词插件
9.6.2. 手工安装插件
9.6.3. 创建索引
9.6.4. 删除索引
9.6.5. 配置索引分词插件
9.7. 索引管理
9.7.1. 查看索引
9.7.2. 删除索引
9.8. 映射
9.8.1. 查看 _mapping
9.8.2. 删除 _mapping
9.8.3. 创建 _mapping
9.8.4. 更新 mapping
9.8.5. 修改 _mapping
9.8.6. 数据类型
9.9. Alias management 别名管理
9.9.1. 查看索引别名
9.9.2. 创建索引别名
9.9.3. 修改别名
9.9.4. 删除别名
9.10. Example
9.10.1. 新闻资讯应用案例
9.10.2. 文章搜索案例
9.11. Migrating MySQL Data into Elasticsearch using logstash
9.11.1. 安装 logstash
9.11.2. 配置 logstash
9.11.3. 启动 Logstash
9.11.4. 验证
9.11.5. 配置模板
9.11.6. 解决数据不对称问题
9.11.7. 修改 Mapping
9.12. ElasticHD
9.13. 安装 Elasticsearch 早起版本
9.13.1. 6.x 安装
9.13.2. 单机模式 (适用于开发环境) 5.x
9.13.3. Elasticsearch Cluster 5.x
9.13.4. RPM 安装
9.13.5. YUM 安装
9.13.6. 测试安装是否正常
9.13.7. Plugin 插件管理
9.14. FAQ
9.14.1. Plugin [analysis-ik] is incompatible with Elasticsearch [2.3.5]. Was designed for version [2.3.4]
9.14.2. plugin [analysis-ik] is incompatible with version [5.6.1]; was designed for version [5.5.2]
9.14.3. mapper_parsing_exception: failed to parse [ctime]
9.14.4. 配置 JAVA_HOME
9.14.5. memory locking requested for elasticsearch process but memory is not locked
10. Manticore Search
10.1. 安装
10.1.1. Ubuntu
10.1.2. Ubuntu
10.1.3. Docker
10.2. Sphinx
11. Solr
11.1. 安装
11.2. Core Admin
11.2.1. Schema
11.3. 索引
11.3.1. Indexing a directory of "rich" files
11.3.2. Indexing Solr XML
11.3.3. Indexing JSON
11.3.4. Deleting Data
11.4. 接口
11.4.1. 查询
11.5. FAQ
11.5.1. NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.
11.6. Solr 1.3.0
11.6.1. Embedded Jetty
11.6.2. Jetty
11.6.3. Tomcat
11.6.4. solr-php-client
11.6.5. multicore
11.6.6. 中文分词
12. Nutch
13. Lucene
14. MG4J
15. PhpDig
16. Mahout
17. Apache Hbase
17.1. 安装 Apache Hbase
17.1.1. 单机模式安装
17.1.2. 伪分布式模式
17.1.3. 分布式模式部署
17.1.4. 运维技巧
17.2. 配置 Apache Hbase
17.2.1. hbase-env.sh
17.2.2. hbase-site.xml
17.3. Hbase Shell
17.3.1. 表操作
17.4. Web UI
17.5. Phoenix
17.5.1. 安装 Phoenix
17.5.2. sqlline.py 命令行界面
17.5.3. SQuirreL SQL Client
17.6. FAQ
17.6.1. HBaseConfTool : Unsupported major.minor version 51.0
17.6.2. ignoring option PermSize=128m; support was removed in 8.0
18. Apache Hive
18.1. 安装 Apache Hive
18.1.1. MySQL
18.1.2. Hadoop
18.1.3. Hive
18.1.4. 启动 Hive
18.1.5. 访问 Hive
18.1.6. 配置 hiveserver2
18.2. beeline
18.3. 管理 Hive
18.3.1. 表管理
18.3.2. 分区表
18.3.3. 视图管理
18.3.4. 数据管理
18.3.5. HDFS与本地文件系统管理
18.4. HiveQL - Hive查询语言
18.4.1. JOIN 连接查询
18.4.2. 子查询
18.5. FAQ
18.5.1. adoop.security.authorize.AuthorizationException): User: hadoop is not allowed to impersonate anonymous
19. Apache Sqoop
19.1. 安装 Sqoop
19.2. sqoop2-tool
19.2.1. verify
19.2.2. upgrade
19.3. sqoop2-shell
19.3.1. show version
19.3.2. set
19.3.3. show connector
19.3.4. link
19.3.5. job
19.3.6. update
19.4. FAQ
19.4.1. Unable to load native-hadoop library for your platform
III. MySQL
20. MySQL Server
20.1. MySQL 安装
20.1.1. Rocky Linux + MySQL 9.5
20.1.2. Rocky Linux 10 + MySQL 8.4
20.1.3. Rocky Linux
20.1.4. CentOS
20.1.5. Docker
20.1.6. Ubuntu/Debian
20.1.7. 源码安装
20.1.8. 二进制版本
20.1.9. Installing MySQL on Linux Using the MySQL Yum Repository
20.1.10. Firewall
20.1.11. Mac OS
20.1.12. 重置数据库
20.1.13. MariaDB
20.1.14. Percona
20.2. MySQL Plugin
20.2.1. validate_password
20.2.2. MySQL Images manager
20.2.3. MySQL fifo
20.2.4. 内容输出到文本插件
20.3. Replication
20.3.1. Master Slave
20.3.2. Master Master(主主)
20.3.3. Semisynchronous Replication
20.3.4. multi-master replication
20.3.5. multi-source replication
20.3.6. 与复制有关的问题
20.3.7. GTID
20.4. MySQL Custer
20.4.1. Management node (MGM node)
20.4.2. Data node
20.4.3. SQL node
20.4.4. Starting
20.4.5. Shutdown
20.4.6. Testing
20.5. MySQL Proxy
20.5.1. Ubuntu
20.5.2. CentOS
20.6. MySQL Router
20.6.1. 安装 MySQL Router
20.6.2. 配置 MySQL Router
20.6.3. MySQL Router , Haproxy,LVS 的选择
20.7. my.cnf
20.7.1. bind-address
20.7.2. 禁用TCP/IP链接
20.7.3. 配置字符集
20.7.4. 最大链接数 max_connections
20.7.5. 默认引擎 storage-engine
20.7.6. max_allowed_packet
20.7.7. skip-name-resolve
20.7.8. timeout
20.7.9. 与复制有关的参数
20.7.10. 与 InnoDB 有关的配置项
20.7.11. EVENT 设置
20.7.12. 日志
20.7.13. MySQL 5.7 my.cnf 实例
20.7.14. Example for my.cnf
20.8. variables
20.8.1. 查询多个变量
20.8.2. time_zone
20.8.3. sql_mode
20.8.4. wait_timeout
20.8.5. table_lock_wait_timeout
20.8.6. low_priority_updates
20.8.7. collation_server
20.8.8. character_set
20.8.9. datadir
20.8.10. plugin_dir
20.8.11. storage_engine
20.8.12. timeout
20.8.13. max_connections
20.8.14. 自动提交 autocommit
20.9. Monitoring
20.9.1. Analysis and Optimization
20.9.2. Cacti
20.9.3. Monitoring MySQL with SNMP
21. Client and Utility Programs
21.1. mysql - the MySQL command-line tool
21.1.1. ~/.my.cnf
21.1.2. 屏幕输出到文件
21.1.3. 终端编码
21.1.4. Unix Socket
21.1.5. 重定向巧用
21.1.6. --sigint-ignore 忽略 Ctrl + C
21.1.7. mysql log
21.2. mysqldump - a database backup program
21.2.1. 备份数据库结构和数据
21.2.2. 备份数据库结构和数据并压缩文件
21.2.3. 备份到文件
21.2.4. 备份数据库结构/表
21.2.5. 备份数据库,无结构,只有数据
21.2.6. 备份所有数据库
21.2.7. 使用完整的insert插入数据
21.2.8. --extended-insert / --skip-extended-insert
21.2.9. --skip-lock-tables
21.2.10. --skip-add-locks
21.2.11. --where
21.2.12. 注释信息--comments /--skip-comments
21.2.13. 不导出注释信息
21.2.14. 字符集设置
21.3. mysqladmin - client for administering a MySQL server
21.3.1. reload
21.3.2. 更改密码
21.3.3. status
21.3.4. process list
21.4. myisamchk — MyISAM Table-Maintenance Utility
21.5. mysqlcheck — A Table Maintenance and Repair Program
21.6. mysqlslap - load emulation client
21.7. mysqldumpslow - Parse and summarize the MySQL slow query log.
21.8. mysql-shell
21.9. mycli
21.10. MySQL慢查询日志(Slow Query Log)
21.10.1. MySQL 8.x
21.10.2. MySQL 5.x
21.11. mysql-admin
21.12. MySQL Workbench 数据库恢复
22. 数据库管理(Database Administration)
22.1. 用户管理(User Account Management)
22.1.1. 创建用户
22.1.2. 删除用户
22.1.3. 修改用户名
22.1.4. 修改密码
22.2. Access Privilege System
22.2.1. SHOW GRANTS
22.2.2. show privileges
22.2.3. Grant privileges
22.2.4. Revoke privileges
22.2.5. Show Privileges
22.2.6. MAX_QUERIES_PER_HOUR/MAX_UPDATES_PER_HOUR
22.2.7. Table Privileges
22.2.8. Column Privileges
22.3. 字符集转换
22.3.1. 转换 latin1 到 UTF-8
22.4. 重新整理AUTO_INCREMENT字段
22.5. 数据库内容替换
22.6. Kill 脚本
22.7. MySQL 时区管理
22.8. SHOW COMMAND
22.8.1. 查看版本
22.8.2. status
22.8.3. show processlist
22.8.4. 线程的使用情况
22.8.5. DATABASES
22.8.6. 排序统计信息
22.8.7. Key 状态
22.8.8. FUNCTION
22.8.9. PROCEDURE
22.8.10. TRIGGERS
22.8.11. EVENTS
22.8.12. 引擎(ENGINES)
22.8.13. 字符集(Collation)
22.8.14. SHOW GRANTS
22.8.15. validate_password
22.9. Maintenance 数据库维护
22.9.1. CHECK 检查表
22.9.2. ANALYZE 分析表
22.9.3. CHECKSUM
22.9.4. OPTIMIZE 优化表
22.9.5. REPAIR 修复
22.10. INFORMATION_SCHEMA
22.10.1. 查询表字段
22.10.2. 列出所有触发器
22.10.3. 查看表数据尺寸
22.11. Backup and Recovery
22.11.1. Import / Export
22.11.2. Snapshot Backup
23. DDL - Data Definition Language
23.1. 数据库管理(Database)
23.1.1. 创建数据库
23.1.2. 删除数据库
23.1.3. 修改数据库
23.1.4. 重命名数据库
23.1.5. 修改字符集
23.1.6. 查看数据库创建语句
23.2. 表管理(Table)
23.2.1. 数据类型
23.2.2. POINT
23.2.3. 基于现有表结构创建新空表
23.2.4. 基于已存在表创建新表
23.2.5. 修改表
23.2.6. 临时表
23.2.7. CHARACTER
23.2.8. DEFAULT
23.2.9. KEY
23.2.10. 虚拟列
23.2.11. COMMENT
23.2.12. 修改表名
23.2.13. Engine 存储引擎
23.3. Partitioning
23.3.1. RANGE
23.3.2. LIST
23.3.3. HASH
23.3.4. KEY分区
23.3.5. Subpartitioning
23.3.6. 分区管理
23.3.7. EXPLAIN PARTITIONS
23.3.8. SHOW CREATE TABLE
23.3.9. INFORMATION_SCHEMA.partitions 表
23.3.10. 分区数据操作
23.4. Index
23.4.1. SHOW INDEX
23.4.2. CREATE INDEX
23.4.3. DROP INDEX
23.4.4. rebuild
23.5. 外键(Foreign Key)
23.5.1. FOREIGN KEY (RESTRICT)
23.6. 视图(View)
23.7. 存储过程(PROCEDURE)
23.7.1. 存储程序
23.7.2. EXECUTE 执行 SQL
23.7.3. PREPARE 传递参数
23.7.4. 存储过程返回数据
23.7.5. 结果集转JSON
23.7.6. 例子·过程返回结果
23.8. 函数
23.8.1. TIMESTAMP TO ISO8601
23.9. 触发器(Trigger)
23.9.1. create trigger
23.9.2. drop trigger
23.9.3. show triggers
23.9.4. EXAMPLE
23.10. 事件调度器(EVENT)
23.10.1. 启用 EVENT
23.10.2. 创建 EVENT
23.10.3. 禁用/启用
23.10.4. 查看 events
23.10.5. 删除 EVENT
23.10.6. EVENT 应用案例
24. DML (Data Manipulation Language)
24.1. INSERT 插入
24.1.1. INSERT INTO ... SELECT
24.1.2. INSERT IGNORE
24.1.3. INSERT...ON DUPLICATE KEY UPDATE
24.2. REPLACE 替换
24.3. DELETE 删除
24.3.1. 删除重复数据
24.3.2. 删除重复数据保留第一条
25. SQL Statement Syntax
25.1. DISTINCT
25.2. JOIN
25.2.1. LEFT JOIN / LEFT OUTER JOIN
25.2.2. JOIN / INNER JOIN
25.3. order by 排序
25.3.1. 处理 null
25.4. group by
25.4.1. 忽略 NULL
25.4.2. 分组统计
25.5. HAVING
25.6. REGEXP
25.7. IN / NOT IN
25.8. ALL / Any
25.9. exists, not exists
25.10. UNION
25.10.1. UNION ALL
25.10.2. 两张表字段不对等解决方法
25.11. OUTFILE/LOAD DATA INFILE
25.11.1. Export data to CSV from MySQL
25.11.2. Import data from CSV file.
25.12. CASE Syntax
25.13. 查询结果放入变量
25.14. MySQL 专有命令
25.14.1. SQL_NO_CACHE
25.14.2. SIGNAL Syntax
25.15. SQL 92
26. Functions and Operators
26.1. COUNT
26.2. UUID()
26.3. 字符串
26.3.1. LEFT/RIGHT
26.3.2. RPAD/LPAD
26.3.3. CONCAT
26.3.4. CONCAT_WS
26.3.5. 链接所有字段
26.3.6. GROUP_CONCAT
26.3.7. replace 字符串替换
26.3.8. SUBSTRING
26.3.9. SUBSTRING_INDEX
26.3.10. AES_ENCRYPT / AES_DECRYPT
26.4. Date and Time
26.4.1. year/month/day hour:minite:second
26.4.2. Unix time
26.4.3. DATE_FORMAT
26.4.4. DATE_SUB/DATE_ADD
26.4.5. datediff / timediff
26.4.6. 当前日期 CURDATE()
26.4.7. 07:04 转成秒
26.5. 数值函数
26.5.1. cast 类型转换
26.5.2. truncate 保留小数位数
26.5.3. MOD 求余
26.5.4. 无符号整型,减法操作,回零操作
26.6. Control Flow Functions
27. DCL (Data Control Language)
27.1. 锁
27.1.1. 共享锁
27.1.2. 排他锁
27.1.3. 锁
27.1.4. 锁等待与超时
27.2. 事务处理和锁定语句
27.2.1. 事务隔离级别
27.2.2. 事务所用到的表
27.2.3. 解决更新冲突
27.2.4. 共享锁
27.2.5. SAVEPOINT
28. Optimization
28.1. Limit 状态
28.2. 使用 Btrfs 文件系统存储mysql数据
28.3. 打开表的数量
28.4. Buffering and Caching
28.4.1. Query Cache SELECT Options
28.5. where 优化
28.6. SHOW PROFILE Syntax SQL性能分析器
28.7. PROCEDURE ANALYSE()
29. MySQL Connectors
29.1. JDBC
29.2. ODBC
29.3. MySQL native driver for PHP - mysqlnd
29.4. python-mysqldb
30. MySQL GUI/Web Manager
30.1. HeidiSQL
30.2. Toad for MySQL Freeware
30.3. phpMyAdmin - MySQL web administration tool
30.4. Maatkit Essential command-line utilities for MySQL
31. Miscellaneous
31.1. Multi-Master Replication Manager for MySQL
31.2. MHA
31.3. Maatkit
31.4. Mroonga
31.5. Amoeba
32. FAQ
32.1. Reset root password 重置MySQL root密码
32.1.1. MySQL 5.7.x
32.1.2. MySQL 8.0
32.2. 查看错误代码
32.2.1. ERROR 1153 (08S01) at line 3168: Got a packet bigger than 'max_allowed_packet' bytes
32.2.2. ERROR 1129 (00000): Host 'XXXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
32.3. 临时表是否需要建索引
32.4. [Warning] Changed limits: max_open_files: 5000 (requested 20480)
32.5. Table 'performance_schema.session_variables' doesn't exist
32.6. SQL Error (1038): Out of sort memory, consider increasing server sort buffer size
32.7. this is incompatible with sql_mode=only_full_group_by
32.8. ERROR 1071 (42000) at line 25: Specified key was too long; max key length is 767 bytes
32.9. ERROR 1086 (HY000): File '/var/lib/mysql-files/order.txt' already exists
32.10. ERROR 1114 (HY000): The table 'your_table' is full
32.11. Error Code: 1146. Table 'test.CACHE_UPDATE' doesn't exist
32.12. Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.
32.13. ERROR 1273 (HY000) at line 3364: Unknown collation: 'utf8mb4_0900_ai_ci'
32.14. ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
32.15. ERROR 1364: 1364: Field 'id' doesn't have a default value
32.16. Error Code: 1292. Incorrect datetime value: '0000-00-00 00:00:00' for column 'create_time' at row 95692
32.17. ERROR 1415: Not allowed to return a result set from a trigger
32.18. ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
32.19. ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
32.20. ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
32.21. ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
32.22. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
32.23. ERROR 2013 (HY000): Lost connection to MySQL server during query
32.24. ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
32.25. ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
32.26. Error Code: 3780. Referencing column 'id' and referenced column 'id' in foreign key constraint 'FKfeti3hcwwku7l7xqru4emwkc6' are incompatible.
32.27. Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such fileor directory
32.28. com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed
32.29. mysqldump: Couldn't execute 'SELECT COLUMN_NAME,
32.30. this is incompatible with sql_mode=only_full_group_by
32.31. mysqldump: [Warning] Using a password on the command line interface can be insecure.
32.32. mysql: [Warning] Using a password on the command line interface can be insecure.
32.33. 时间自动被加一秒
33. Redis
33.1. Redis 安装
33.1.1. Rocky Linux
33.1.2. CentOS 8 Stream
33.1.3. CentOS 7
33.1.4. CentOS 6
33.1.5. Ubuntu
33.1.6. Mac 安装 Redis
33.1.7. 源码编译安装
33.1.8. Test Redis
33.2. /etc/redis.conf
33.2.1. 备份配置文件
33.2.2. 绑定配置
33.2.3. 密码认证
33.2.4. maxmemory-policy TTL 过期策略配置
33.2.5. aclfile
33.3. redis-cli - Command-line client to redis-server
33.3.1. 命令参数
33.3.2. --latency Enter a special mode continuously sampling latency.
33.3.3. 清空指定数据库
33.3.4. 用户认证
33.3.5. ACL 用户/密码认证
33.3.6. MONITOR
33.3.7. info
33.3.8. save/bgsave/lastsave
33.3.9. config
33.3.10. keys
33.3.11. 字符串操作
33.3.12. expire/ttl
33.3.13. 获取 key 类型
33.3.14. LIST 数据类型
33.3.15. set 无序字符集合
33.3.16. zset (有序集合)
33.3.17. HASH
33.3.18. Pub/Sub 订阅与发布
33.3.19. flushdb 清空 Redis 数据
33.4. redis-benchmark 测试工具
33.5. Redis Cluster
33.6. Redis 通信协议
33.6.1. 切换DB
33.6.2. 监控
33.7. Redis 开发
33.7.1. 消息订阅与发布
33.7.2. 选择数据库
33.8. 工具
33.8.1. 导出 / 导入
33.8.2. phpRedisAdmin
33.8.3. A fast, light-weight proxy for memcached and redis
33.9. FAQ
33.9.1. 清空数据库
33.9.2. (error) MISCONF Redis is configured to save RDB snapshots
33.9.3. You can't write against a read only replica.
33.9.4. MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
33.9.5.
34. valkey
34.1. 安装 valkey
34.1.1. dnf 安装
34.1.2. docker 安装
34.2. 配置 valkey
34.2.1. listen 地址配置
34.2.2. 设置密码
34.3. valkey-cli
34.3.1. Valkey
34.4. 客户端库
IV. MongoDB
35. Install 安装MongoDB
35.1. CentOS 8 Stream
35.2. MacOS 安装 MongoDB
35.3. 二进制tar包安装
35.4. Ubuntu MongoDB
35.5. CentOS 7 MongoDB
35.6. 从官网安装最新版本的 MongoDB 3.4
35.6.1. Server
35.6.2. Client
35.6.3. 工具
35.7. MongoDB + Hadoop
35.8. OSCM 一键安装 MongoDB 4.0.2
35.9. Replication
35.9.1. Master
35.9.2. Slave
35.9.3. 测试
35.10. Drivers
35.10.1. Using MongoDB in PHP
36. MongoDB 管理
36.1. Security and Authentication
36.1.1. 超级管理员
36.1.2. 数据库访问用户
36.1.3. 数据库监控用户
36.1.4. 删除用户
36.1.5. 更新角色
36.2. 4.0早期旧版本
37. 命令工具
37.1. mongo - MongoDB Shell
37.1.1. eval
37.1.2. help
37.1.3. 登陆认证
37.1.4. 管道操作
37.2. mongodump - Backup
37.2.1. 本地备份
37.2.2. 远程备份
37.3. mongorestore
37.3.1. 本地恢复
37.3.2. 远程恢复
37.3.3. filter
37.4. mongostat
37.5. mongotop
37.6. mongofiles - Browse and modify a GridFS filesystem.
37.6.1. list 浏览文件
37.6.2. put 上传文件
37.6.3. get 下载
37.6.4. delete 删除
38. MongoDB Shell
38.1. shutdownServer
38.2. show 查看命令
38.2.1. show dbs
38.2.2. show collections
38.2.3. show users
38.2.4. show profile
38.3. 切换数据库
38.4. Collection 管理
38.4.1. 创建 Collection
38.4.2. 删除 collection
38.4.3. 删除字段
38.5. save
38.6. insert
38.7. update
38.7.1. multi 更新所有数据
38.7.2. upsert 更新,如果不存在则插入数据
38.7.3. updateMany 更新集合中的所有数据
38.8. remove
38.8.1. 删除条件使用 _id
38.9. count()
38.10. 查询
38.10.1. find() MongoDB 2.x
38.10.2. find() MongoDB 3.x
38.10.3. group()
38.11. aggregate
38.11.1. project
38.11.2. groupby + sum
38.12. Indexes 索引
38.12.1. 查看索引
38.12.2. 创建索引
38.12.3. 删除索引
38.12.4. 唯一索引
38.12.5. 复合索引
38.12.6. 稀疏索引
38.13. Map-Reduce
38.13.1. 使用 Map-Reduce 统计Web 服务器 access.log 日志文件
38.14. 内嵌对象
38.14.1. Array / List 列表类型
38.15. Javascript 脚本
39. Mongo Admin UI
39.1. RockMongo
39.2. MongoVUE
40. Cassandra
40.1. Getting Started
40.1.1. Downloading and Installation
40.1.2. Running Cassandra
40.1.3. cli tool
40.1.4. Testing Cassandra
40.2. Configure Cassandra
40.2.1. Envionment variables
40.2.2. log4j.properties
40.2.3. storage-conf.xml
40.3. Keyspace
40.3.1. Schema
40.3.2. Keyspace example
40.4. Cluster
40.4.1. Running a cluster
40.4.2. Running a single node
40.4.3. nodetool
41. Hypertable
41.1. Hypertable 安装
41.1.1. Hypertable standalone 单机安装
41.1.2. Hypertable on HDFS(hadoop) 安装
41.1.3. MapR
41.1.4. Ceph
41.1.5. 检验安装
41.2. Code examples
41.2.1. PHP
41.3. HQL
41.3.1. namespace 命名空间管理
41.3.2. Table 表
41.4. FAQ
41.4.1. 切换 DFS Broker
42. CouchBase
42.1. 安装 CouchBase
42.1.1. Getting Started with Couchbase on PHP
42.2. couchbase 命令
42.2.1. couchbase-cli
43. Memcached
43.1. 安装 Memcached
43.1.1. CentOS 下编译
43.1.2. Ubuntu 下编译安装
43.1.3. debian/ubuntu
43.1.4. yum install
43.2. Memcached 代理
43.2.1. moxi
43.2.2. memagent
44. RethinkDB
45. TokyoCabinet/Tyrant
46. Flare
47. Voldemort
48. LevelDB
49. HyperDex
50. LeoFS
V. PostgreSQL
51. PostgreSQL 安装
51.1. Rocky Linux / Almalinux
51.2. Ubuntu 12.04.1 LTS 安装
51.3. YUM 默认源安装
51.4. PostgreSQL 官方 YUM 源安装
51.4.1. 9.2
51.4.2. 9.3
51.4.3. 9.4
51.4.4. 9.6
51.4.5. PostgreSQL 10
51.5. PostgreSQL 配置
51.5.1. postgresql.conf
51.5.2. pg_hba.conf
51.6. 创建dba用户
52. PostgreSQL 命令
52.1. psql - PostgreSQL interactive terminal
52.1.1. 执行文件
52.2. Backup / Restore
52.2.1. Backup
52.2.2. Restore
52.2.3. import
52.2.4. 导出指定 schema
52.2.5. PostgreSQL for windows
52.2.6. 大型数据库备份
52.2.7. schema之间迁移数据
52.2.8. Docker 恢复数据
52.3. 创建数据库
52.4. 删除数据库
53. 数据定义(DDL)
53.1. 模式
53.2. Types
53.2.1. Enumerated Types
53.2.2. uuid
53.3. 表
53.3.1. 默认时间与时区
53.3.2. 汉字做字段名
53.4. 序列
53.4.1. 等差列 “1,2,3,4,5,6,7,8,9…”
53.4.2. 等差列 “1,3,5,7,9…”
53.4.3. 等差列 “2,4,6,8,10…”
53.4.4. n1+n2
53.5. 约束
53.5.1. 检查约束
53.5.2. 非空约束
53.5.3. 唯一约束
53.6. 主键/外键
53.6.1. 主键
53.6.2. 外键约束
53.6.3. 案例
54. DML
54.1. INSERT
54.1.1. 自动截取字符串
54.1.2. INSERT IGNORE INTO
54.2. copy
54.2.1. wget
55. SQL
55.1. "::"数据转换
55.2. ORDER BY 排序
55.3. 递归查询
55.4. returning
57. 事务处理与锁
57.1. FOR UPDATE SKIP LOCKED
57.2. FOR SHARE
58. PostgreSQL GUI
58.1. pgAdmin III
58.2. phpPgAdmin
58.3. Monitoring
58.3.1. PgBadger
58.4. pgModeler - PostgreSQL Database Modeler
59. Barman Backup & recovery for PostgreSQL
60. Connector
60.1. Pomm
61. Replication
61.1. Bucardo
62. FAQ
62.1. MySQL to PostgreSQL
VI. Oracle
63. Oracle 12c 安装可
63.1. Server 安装
63.2. Desktop 安装
63.3. Oracle Net Services Configuration
63.3.1. Listener configuration
63.3.2. Local Net Service Name configuration
63.4. Oracle 12c Client for Windows 10
63.5. 卸载 Oracle
63.6. Linux 安装 sqlplus
64. Privilege
64.1. Account
64.1.1. show user
64.1.2. DEFAULT_TABLESPACE
64.1.3. unlock/lock
64.2. User
64.2.1. Create user
64.2.2. Drop user
64.2.3. Alter user
64.2.4. 修改密码
64.2.5. Reset Password 忘记密码重置密码
64.3. grant
64.3.1. 列出权限
64.3.2. 查看用户权限
64.3.3. 吊销权限
64.3.4. System Privileges 系统权限
64.3.5. Object Privileges 对象权限
64.4. Opening the Encrypted Wallet
65. 数据库管理
65.1. lsnrctl
65.2. listener.ora
65.3. TNS 配置
65.3.1. HOST
65.3.2. SID
65.4. parameter
65.4.1. db
65.4.2. instance_name
65.4.3. service_name
65.4.4. global_name
65.4.5. db_name
65.4.6. db_domain
65.4.7. sga
65.4.8. size
65.4.9. spfile
65.4.10. cache
65.4.11. Character Set
65.5. 进程
65.6. 查看用户
65.7. 显示表
65.8. 显示试图
65.9. PROCEDURE
65.10. FUNCTION
65.11. 视图、存储过程、函数
65.12. 查看存储过程源代码
65.13. 日期时间格式
65.13.1. Date
65.13.2. 修改系统日期格式
65.13.3. TIMESTAMP
65.13.4.
65.14. 切换字符集
65.14.1. 切换到 GBK
65.14.2. 切到 UTF-8
65.14.3. 切到 AL32UTF8
65.14.4. 切换过程实例
65.15. Oracle 表空间
65.15.1. 查询空闲表空间
65.15.2. 创建表空间
65.15.3. 更改表空间属性
65.15.4. 删除表空间
66. Oracle Gui
66.1. Create instance
66.2. Oracle Net Configuration Assistant
66.3. Oracle Enterprise Manager
66.3.1. EM Configuration issue. /opt/oracle/product/11.2.0/dbhome_1/orcl.example.com_orcl not found.
66.4. Other GUI - phpOraAdmin
67. CLI
67.1. SQL*Plus
67.1.1. conn
67.1.2. startup/shutdown
67.1.3. $ORACLE_HOME/sqlplus/admin/glogin.sql
67.1.4. @运行SQL
67.1.5. 链接数据库
67.2. exp/imp
67.2.1. exp
67.2.2. imp
67.3. expdp/impdp
67.3.1. expdp
67.3.2. impdp
67.3.3. 数据泵演示
67.3.4. 查看dmp文件的表空间
67.4. RMAN
67.4.1. 数据库模式
67.4.2. 完全备份
67.4.3. 增量备份
67.4.4. 恢复数据库
67.4.5. 是用tar打包rman文件
67.4.6. 打包 rman 备份文件
68. DDL
68.1. 字段类型
68.1.1. Date
68.1.2. TIMESTAMP
68.2. 索引
68.3. 表
68.3.1.
68.3.2. 约束检查
68.4. SEQUENCE 序列
68.4.1.
69. 程序包
69.1. 执行包中的过程
70. 数据库链接
71. Oracle 监控
71.1. Oracle日志的路径
71.2. SQL 日志监控
71.2.1. 查询性能分析
71.2.2. IO性能分析
71.3. session
71.4. SQL Monitoring Report
72. Installing Oracle Database
72.1. Installing Oracle Database 10g Release 2 on Linux x86
72.2. 11gR2
72.3. Installing Oracle Client 11g
72.4. Silence Install - Database
72.4.1. Response File
72.4.2. OS 配置脚本
72.4.3. 运行 runInstaller
72.5. Silence Install - Client
72.6. oracle 817 script
72.7. Script for automatic startup on boot
72.8. Run level shell script to start Oracle 10g services on RedHat Enterprise Linux (RHAS 4)
73. FAQ
73.1. Reset root password 重置MySQL root密码
73.1.1. MySQL 5.7.x
73.1.2. MySQL 8.0
73.2. 查看错误代码
73.2.1. ERROR 1153 (08S01) at line 3168: Got a packet bigger than 'max_allowed_packet' bytes
73.2.2. ERROR 1129 (00000): Host 'XXXXXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
73.3. 临时表是否需要建索引
73.4. [Warning] Changed limits: max_open_files: 5000 (requested 20480)
73.5. Table 'performance_schema.session_variables' doesn't exist
73.6. SQL Error (1038): Out of sort memory, consider increasing server sort buffer size
73.7. this is incompatible with sql_mode=only_full_group_by
73.8. ERROR 1071 (42000) at line 25: Specified key was too long; max key length is 767 bytes
73.9. ERROR 1086 (HY000): File '/var/lib/mysql-files/order.txt' already exists
73.10. ERROR 1114 (HY000): The table 'your_table' is full
73.11. Error Code: 1146. Table 'test.CACHE_UPDATE' doesn't exist
73.12. Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.
73.13. ERROR 1273 (HY000) at line 3364: Unknown collation: 'utf8mb4_0900_ai_ci'
73.14. ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
73.15. ERROR 1364: 1364: Field 'id' doesn't have a default value
73.16. Error Code: 1292. Incorrect datetime value: '0000-00-00 00:00:00' for column 'create_time' at row 95692
73.17. ERROR 1415: Not allowed to return a result set from a trigger
73.18. ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
73.19. ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
73.20. ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
73.21. ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
73.22. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
73.23. ERROR 2013 (HY000): Lost connection to MySQL server during query
73.24. ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
73.25. ERROR 3024 (HY000): Query execution was interrupted, maximum statement execution time exceeded
73.26. Error Code: 3780. Referencing column 'id' and referenced column 'id' in foreign key constraint 'FKfeti3hcwwku7l7xqru4emwkc6' are incompatible.
73.27. Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such fileor directory
73.28. com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed
73.29. mysqldump: Couldn't execute 'SELECT COLUMN_NAME,
73.30. this is incompatible with sql_mode=only_full_group_by
73.31. mysqldump: [Warning] Using a password on the command line interface can be insecure.
73.32. mysql: [Warning] Using a password on the command line interface can be insecure.
73.33. 时间自动被加一秒
74. ClickHouse
74.1. 安装 Clickhouse
74.1.1. RPM 安装
74.2. 客户端
75. Milvus 向量数据库
75.1. 安装 Milvus
75.2. 安装 Milvus insight 管理界面
75.3. 问答模型
75.4. milvus-cli
75.4.1. 安装 milvus-cli
75.4.2. 查看帮助信息
75.4.3. 链接数据库
75.4.4.
75.4.5. 查看数据库
75.4.6. 数据库管理
75.4.7.
75.4.8. 查询
75.4.9. 删除操作
75.4.10.
75.5. Python SDK
75.5.1. 数据库管理
75.5.2. 创建分区
75.5.3. Example
75.5.4. FAQ
76. sqlite
77. 数据库工具
77.1. lazysql 一款基于TUI的数据库管理工具

表格清单

27.1. 更新丢失演示
27.2. 防止更新丢失加锁演示

范例清单

9.1. Elasticsearch master / slave
11.1. Solr - schema.xml
11.2. /etc/profile.d/java.sh
20.1. MySQL 8 创建root账号
20.2. my.cnf
20.3. my.cnf
20.4. my.cnf
23.1. BEFORE/AFTER
23.2. uuid()
25.1. SQL ANY example
28.1. SQL_CACHE 测试
28.2. SHOW PROFILE Syntax
35.1. MongoDB Test
35.2. Using MongoDB in PHP
40.1. Twitter
40.2. Twissandra
43.1. /etc/init.d/memcached
51.1. Example for /var/lib/pgsql/10/data/pg_hba.conf
55.1. 递归查询实例
55.2. 递归查询实例 city 表
55.3. PostgreSQL insert returning
55.4. PostgreSQL update returning
55.5. PostgreSQL delete returning
65.1. Oracle 字符集切换实例
65.2. 创建表空间实例
67.1. expdp
67.2. impdp
67.3. full backup
68.1.
70.1. DB LINK