随笔分类 -  基础配置

摘要:从库 对表做truncate 时报1209 - The MySQL server is running with the--read-only option so it cannot execute this statement 处理: select @@read_only; set global 阅读全文
posted @ 2023-08-02 10:31 刚好遇见Mysql 阅读(260) 评论(0) 推荐(0) 编辑
摘要:mysql强制使用索引:force index(索引名或者主键PRI) select * from table force index(PRI,idx1) limit 2; mysql禁止某个索引:ignore index(索引名或者主键PRI) select * from table ignore 阅读全文
posted @ 2023-03-18 13:58 刚好遇见Mysql 阅读(98) 评论(0) 推荐(0) 编辑
摘要:查看所有日志 show master logs; 从库设置为只读 set global read_only=1; 阅读全文
posted @ 2021-11-18 12:46 刚好遇见Mysql 阅读(16) 评论(0) 推荐(0) 编辑
摘要:登录 mysql -h主机名 -P端口号 -u用户名 -p密码 导出所有数据库mysqldump -u root -p --all-databases >/tmp/all.sql导出指定数据库mysqldump -u root -p --databases db1 db2 >/tmp/user.sq 阅读全文
posted @ 2021-11-18 11:13 刚好遇见Mysql 阅读(42) 评论(0) 推荐(0) 编辑
摘要:测试表employees.t_emp水平分片,按照emp_no分片 配置mycat schema rule 1 [mycat@redis04 conf]$ cat schema.xml 2 <?xml version="1.0"?> 3 <!DOCTYPE mycat:schema SYSTEM " 阅读全文
posted @ 2019-06-04 16:46 刚好遇见Mysql 阅读(221) 评论(0) 推荐(0) 编辑
摘要:下载解压及创建用户组和目录属性 下载地址:1、https://github.com/MyCATApache/Mycat-download。2、http://dl.mycat.io/ wget http://dl.mycat.io/1.6.6.1/Mycat-server-1.6.6.1-releas 阅读全文
posted @ 2018-09-13 18:59 刚好遇见Mysql 阅读(1979) 评论(0) 推荐(0) 编辑
摘要:表锁,锁住整个表 回话a mysql> lock tables sakila.film write; Query OK, 0 rows affected (0.00 sec) 回话b,执行任何语句就hang在那 mysql> select 1 from sakila.film LIMIT 1; 通过 阅读全文
posted @ 2018-08-27 17:25 刚好遇见Mysql 阅读(221) 评论(0) 推荐(0) 编辑
摘要:利用创建硬链接的方式删除表 阅读全文
posted @ 2018-08-22 16:40 刚好遇见Mysql 阅读(436) 评论(0) 推荐(0) 编辑
摘要:本次测试环境是 mysql 5.7.23,表空间为每个表单独表空间 查看表mysql> show create table ht.tb; 优化以后和预计的表空间大小(删除1/3数据,文件减小1/3)一致;从data_free来看也缩小很多;optimize table在操作的准备阶段和提交阶段期间短 阅读全文
posted @ 2018-08-21 01:20 刚好遇见Mysql 阅读(1154) 评论(0) 推荐(0) 编辑
摘要:sql语句优化时没有测试数据,oracle官方提供测试数据 到 https://github.com/datacharmer/test_db下载 安装 阅读全文
posted @ 2018-08-16 18:33 刚好遇见Mysql 阅读(1928) 评论(0) 推荐(1) 编辑
摘要:sync_binlog 控制数据库的binlog刷到磁盘 默认sync_binlog=1,表示每次事务提交,MySQL都会把binlog刷下去,是最安全但是性能损耗最大的设置。 sync_binlog=100或者是0。牺牲一定的一致性,可以获得更高的并发和性能。 innodb_flush_log_a 阅读全文
posted @ 2018-07-07 10:57 刚好遇见Mysql 阅读(160) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示