performance_schema是个啥 By duncan21Posted on 2021 年 10 月 26 日Posted in MySqlTagged performance_schemaNo Comments on performance_schema是个啥 1、什么是performance_schema MySQL的performance schema 用于监控MySQL server在一个较低级别的运行过程中的资源消耗、资源等待等情况,它具有以下特点[……] 阅读全文 Read More
新学到的mysql命令(updating) By duncan21Posted on 2021 年 6 月 30 日2021 年 10 月 26 日Posted in MySqlTagged complete-insert, count, mysqlshow, process, skip-extended-insertNo Comments on 新学到的mysql命令(updating) part1 mysqlshow mysqlshow 显示MySQL中数据库相关信息 补充说明 mysqlshow命令 用于显示mysql服务器中数据库、表和列表信息。 语法 mys[……] 阅读全文 Read More
[转]MySQL大表优化方案 By duncan21Posted on 2021 年 5 月 2 日Posted in MySqlTagged mysql, optimizationNo Comments on [转]MySQL大表优化方案 当MySQL单表记录数过大时,增删改查性能都会急剧下降,可以参考以下步骤来优化: 单表优化 除非单表数据未来会一直不断上涨,否则不要一开始就考虑拆分,拆分会带来逻辑、部署、运维的各种复杂度,一般以[……] 阅读全文 Read More
MySQL8 多源复制 By duncan21Posted on 2021 年 4 月 29 日2021 年 4 月 29 日Posted in MySqlTagged mysql8, 多源复制No Comments on MySQL8 多源复制 一,什么是多源复制: multi-source 是不同的。简单的说,多源复制就是将多个主库同步到一个从库上面,从而增加从的利用率,节省了机器。如下图: 多源复制使用场景 数据[……] 阅读全文 Read More
升级MySQL8,各种问题及最终解决办法 By duncan21Posted on 2021 年 3 月 14 日2021 年 12 月 31 日Posted in MySqlTagged mysql8No Comments on 升级MySQL8,各种问题及最终解决办法 问题: 我使用的是最不常用的源码编译安装,至于它的好处我就不在这里赘述了,我在执行make的时候,出现下面的错误提示: 上网查了一下,说是内存被消耗完了,我的配置是2G的内存,按照网友的说[……] 阅读全文 Read More
variable cant’t be set to the value of ‘null’ By duncan21Posted on 2017 年 10 月 13 日2021 年 4 月 15 日Posted in MySqlTagged nullNo Comments on variable cant’t be set to the value of ‘null’ 今天在导入数据库的时候,出现了下面的错误提示: mysql根据配置文件会限制server接受的数据包大小。 有时候大的插入和更新会受max_allowed_pack[……] 阅读全文 Read More
查看和修改MySQL的字符集相关 By duncan21Posted on 2017 年 5 月 10 日Posted in MySqlTagged MySQL字符集No Comments on 查看和修改MySQL的字符集相关 查看: mysql> select version(); +------------+ | version() | +------------+ | 5.1.69-log | +--[......]阅读全文 Read More
MySql Host is blocked because of many connection errors By duncan21Posted on 2017 年 4 月 6 日2017 年 4 月 6 日Posted in MySqlTagged connection errorsNo Comments on MySql Host is blocked because of many connection errors ySql Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’ 解决方法[……] 阅读全文 Read More
MySQL性能优化之max_connections参数 By duncan21Posted on 2017 年 4 月 6 日Posted in MySqlTagged max_connections, mysqlNo Comments on MySQL性能优化之max_connections参数 MySQL的max_connections参数用来设置最大连接(用户)数。每个连接MySQL的用户均算作一个连接,max_connections的默认值为151。本文将讲解此参数的详细作用与性能影响。[……] 阅读全文 Read More
MySQL全文索引之ft_min_word_len案例 By duncan21Posted on 2016 年 12 月 29 日2016 年 12 月 31 日Posted in MySqlTagged ft_min_word_lenNo Comments on MySQL全文索引之ft_min_word_len案例 今天遇到一个问题,就是明明做了全文索引,但是就是无法查询到 mysql> SELECT id,title,keywords,litpic FROM `health_archives` WHER[......]阅读全文 Read More
MySQL开启慢日志查询 By duncan21Posted on 2016 年 12 月 29 日2016 年 12 月 29 日Posted in MySqlTagged log_slow, mysqlNo Comments on MySQL开启慢日志查询 环境: [root@php219 data]# cat /etc/redhat-release Derived from Red Hat Enterprise Linux 7.1 (Sourc[……] 阅读全文 Read More
amoeba实现MySQL读写分离 By duncan21Posted on 2016 年 12 月 6 日2021 年 4 月 15 日Posted in MySqlTagged amoeba, mysql读写分离No Comments on amoeba实现MySQL读写分离 测试环境: centos6+mysql5.1+amoeba2.2.0 测试拓扑: #在mysql-amoeba上操作 amoeba需要java的支持,首先安装java #[……] 阅读全文 Read More
记录一次MySQL主从同步时候出现的错误代码1449 By duncan21Posted on 2016 年 12 月 5 日Posted in MySqlTagged mysql1499No Comments on 记录一次MySQL主从同步时候出现的错误代码1449 今天在做主从同步的时候,在show slave status\g的时候出现下面的错误: The user specified as a definer (‘root’@’192.168.1.11[……] 阅读全文 Read More
记录一次生产环境下的主从不同步的案例 By duncan21Posted on 2016 年 11 月 7 日Posted in MySqlTagged 主从不同步No Comments on 记录一次生产环境下的主从不同步的案例 //环境: centos6 mysql5.1* //从库不同步了 mysql> show slave status\G *************************** 1.[......]阅读全文 Read More
如何在win2008下检测到sql server的死锁 By duncan21Posted on 2016 年 8 月 25 日2016 年 8 月 25 日Posted in MySqlTagged sql serverNo Comments on 如何在win2008下检测到sql server的死锁 阻塞,是指当一个数据库会话中的事务,正在锁定其他会话事务想要读取或修改的资源,造成这些会话发出的请求进入等待的状态。SQL Server 默认会让被阻塞的请求无限期地一直等待,直到原来的事务释放相关的[……] 阅读全文 Read More
[转]mysql状态查看 QPS/TPS/缓存命中率查看 By duncan21Posted on 2016 年 8 月 25 日Posted in MySqlTagged mysql 运行中的mysql状态查看 对正在运行的mysql进行监控,其中一个方式就是查看mysql运行状态。 (1)QPS(每秒Query量) QPS = Questions(or Querie[……] 阅读全文 Read More
使用php连接mysql By duncan21Posted on 2016 年 7 月 18 日2016 年 8 月 25 日Posted in MySqlTagged mysql, php <?php $mysql_server_name='127.0.0.1'; $mysql_username='root'; $mysql_password=''; $[......]阅读全文 Read More
Mycat实现MySQL读写分离 By duncan21Posted on 2016 年 6 月 27 日2017 年 1 月 26 日Posted in MySqlTagged mycat 环境 MySQL版本: mysql> select version(); +————+ | version() | +————+ | 5.6.30-l[……] 阅读全文 Read More
mysql分区 By duncan21Posted on 2016 年 6 月 7 日2016 年 6 月 12 日Posted in MySql //查看表结构 //选取表的aid字段,通过hash将表分为10个区,并指定特定的逻辑分区 //每个分区中生成了数据文件和索引文件 [codesyntax lang=”tex[……] 阅读全文 Read More
如何查看mysql执行的所有以往 sql 语句历史命令 By duncan21Posted on 2016 年 4 月 1 日2021 年 7 月 16 日Posted in MySqlTagged mysql, 查看mysql命令 查看mysql执行的所有以往 sql 语句历史命令 环境: [root@bacula_server backup]# cat /etc/redhat-release CentOS relea[……] 阅读全文 Read More