摘要: 二分查找法每次都排查一半的数字,包含则返回其位置,否则返回null。二分查找法的元素列表必须是有序的。 Python 2 示例: def binary_search(list, item): low = 0 high = len(list)-1 while low <= high: mid = (l 阅读全文
posted @ 2021-09-28 20:31 龙虚度 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 简介: 目前在研究如何在K8S上使用MySQL,查看招商银行、搜狗等公司的分享基本上是通过Operator来维护,GitHub上找了下,有参考价值的MySQL Operator 有下面这三个,后面文章会依次做一些简单测试与使用。 Oracle MySQL https://github.com/mys 阅读全文
posted @ 2021-09-28 16:18 龙虚度 阅读(690) 评论(0) 推荐(0) 编辑
摘要: 基础: 三台2核2G虚拟机 CentOS 7 192.168.5.101 192.168.5.102 192.168.5.103 一、基础配置(所有节点都关闭) 1、关闭防火墙、selinux、SWAP systemctl stop firewalld && systemctl disable fi 阅读全文
posted @ 2021-07-07 11:33 龙虚度 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 在写脚本时经常需要在命令行使用明文密码,虽然不安全,但是很方便,出现[Warning] Using a password 就很讨厌,下面给出个解决方式 方法: 使用 2>/dev/null #mysql --user=root --password=123456 -e "select version 阅读全文
posted @ 2021-07-01 11:36 龙虚度 阅读(1268) 评论(0) 推荐(0) 编辑
摘要: 报错如下: Cannot set LC_ALL to locale en_US.UTF-8: No such file or directory 解决方式: 1、Ubuntu操作系统 apt-get install -y locales locale-gen en_US.UTF-8 2、CentOS 阅读全文
posted @ 2021-06-24 11:27 龙虚度 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 简介: pip install pymssql==2.1.3 安装时报错如下: Running setup.py install for pymssql ... error ERROR: Command errored out with exit status 1: command: /python 阅读全文
posted @ 2021-03-16 16:22 龙虚度 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 简介: 在python虚拟环境中执行 pip install mysqlclient==1.3.10 报错以下错误: ERROR: Command errored out with exit status 1: command: /python/opsmind_env/bin/python3 -c 阅读全文
posted @ 2021-03-16 16:08 龙虚度 阅读(1508) 评论(0) 推荐(0) 编辑
摘要: 背景:多个表执行alter table tbl_name engine=innodb;优化表空间空洞问题时报错 > 1878 - Temporary file write failure. 原因:MySQL默认tmp磁盘空间太小,不够存放多个表的磁盘临时表。 阅读全文
posted @ 2021-01-26 09:46 龙虚度 阅读(107) 评论(0) 推荐(0) 编辑
摘要: cd %GOPATH%go env -w GOPROXY=https://goproxy.io,directgo env -w GO111MODULE=on go get golang.org/x/tools/gopls@latest 结束记得关闭go env -w GO111MODULE=off 阅读全文
posted @ 2020-08-10 15:34 龙虚度 阅读(1282) 评论(0) 推荐(0) 编辑
摘要: # cat life.go package main import "fmt" func main() { fmt.Println("人生苦短, Let's Go!") } 阅读全文
posted @ 2020-08-03 21:59 龙虚度 阅读(79) 评论(0) 推荐(0) 编辑