随笔分类 -  MySQL

1
摘要:[root@test153 ~]# wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.3.4/binary/redhat/6/x86_64/percona-xtrabackup-2.3.4-1.el6.x86 阅读全文
posted @ 2020-10-16 10:24 ritchy 阅读(1576) 评论(0) 推荐(0)
摘要:现在用的MySQL引擎基本都是innodb,但下面的 规则1:一般情况可以选择MyISAM存储引擎,如果需要事务支持必须使用InnoDB存储引擎。注意:MyISAM存储引擎 B-tree索引有一个很大的限制:参与一个索引的所有字段的长度之和不能超过1000字节。另外MyISAM数据和索引是分开,而I 阅读全文
posted @ 2020-05-17 19:35 ritchy 阅读(524) 评论(0) 推荐(0)
摘要:目录1.使用mysqldump实现逻辑备份2.恢复逻辑备份3.备份/恢复案例4.实现自动化备份5.表的导出和导入6.数据库迁移# 1. 物理备份: 直接复制数据库文件,适用于大型数据库环境。但不能恢复到异构系统中如Windows。# 2. 逻辑备份: 备份的是建表、建库、插入等操作所执行SQL语句, 阅读全文
posted @ 2019-12-25 00:36 ritchy 阅读(210) 评论(0) 推荐(0)
摘要:在公司随便找3台测试机搭个MHA,下面这个问题折腾了三天,之前没遇到过,查了OS版本发现一致,可能是不同人弄的OS吧,知道是cpan的问题就是搞不定,郁闷。。。[root@test247 ~]# masterha_check_repl --conf=/etc/masterha/app1.cnfWed 阅读全文
posted @ 2019-12-04 15:26 ritchy 阅读(3604) 评论(0) 推荐(0)
摘要:看这个账户有点碍眼就删除了,结果异常了mysql> select user,host from mysql.user;+ + +| user | host |+ + +| repmha | 192.168.5.% || mysql.session | localhost || mysql.sys | 阅读全文
posted @ 2019-11-27 10:49 ritchy 阅读(293) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/u013415591/article/details/82692242https://blog.csdn.net/gx_1_11_real/article/details/81066336 迁移之前没这个问题,原来迁移后没将lower_case_table 阅读全文
posted @ 2019-11-21 15:49 ritchy 阅读(1034) 评论(0) 推荐(0)
摘要:[root@test153 ~]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql_data1 /usr/local/mysql/bin/my 阅读全文
posted @ 2019-11-05 16:30 ritchy 阅读(3892) 评论(0) 推荐(0)
摘要:ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1创建表之后不能插入中文字符?为啥呢?了解字符集的重要性。它必须在建库之前要确定好,恢复备份时也需要注意 mys 阅读全文
posted @ 2019-10-30 19:30 ritchy 阅读(1213) 评论(0) 推荐(0)
摘要:mysql> show slave status \G Slave_IO_Running: No Slave_SQL_Running: Yes Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 1236 Last_IO_Error: Got fatal 阅读全文
posted @ 2019-10-30 17:24 ritchy 阅读(926) 评论(0) 推荐(0)
摘要:【问题】mysql从5.6升级到5.7后出现:插入数据和修改数据时出错Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: The error occurred while applying a parameter map. 阅读全文
posted @ 2019-10-29 11:58 ritchy 阅读(7921) 评论(0) 推荐(0)
摘要:[oot@cent65 bin]# service mysqld startStarting MySQL.2019-10-28T15:56:47.786960Z mysqld_safe error: log-error set to '/data/log/mysqld.log', however f 阅读全文
posted @ 2019-10-29 00:55 ritchy 阅读(3886) 评论(1) 推荐(0)
摘要:修改密码报异常mysql> update user set password=password("y1jhcfzX!") where user="root"; 异常[root@ddtest-mysql01 ~]# mysql -uroot -pEnter password: ERROR 1045 ( 阅读全文
posted @ 2019-10-28 17:05 ritchy 阅读(514) 评论(0) 推荐(0)
摘要:脚本里面没有把同步时间写进去,这个写在最前面yum install -y ntp ntpdatecp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 执行下列语句之前,请详细了解ntp和ntpdate的区别,由于我这里是测试环境,所以ntpda 阅读全文
posted @ 2019-10-24 17:54 ritchy 阅读(745) 评论(0) 推荐(0)
摘要:转自 https://blog.csdn.net/ashic/article/details/75645479 以下是MHA(masterha_manager)在监控和故障切换上的基本流程 验证复制配置和识别当前主库 通过连接配置文件中描述的所有主机来识别当前主库.你不必手动指明那个主句是主库,MH 阅读全文
posted @ 2019-10-11 16:57 ritchy 阅读(470) 评论(0) 推荐(0)
摘要:10分钟搞懂:亿级用户的分布式数据存储解决方案https://www.cnblogs.com/lagou/p/11011682.html 阅读全文
posted @ 2019-08-05 11:53 ritchy 阅读(580) 评论(0) 推荐(0)
摘要:主从介绍Mysql主从又叫Replication、AB复制。简单讲就是A与B两台机器做主从后,在A上写数据,另外一台B也会跟着写数据,实现数据实时同步mysql主从是基于binlog,主上需开启binlog才能进行主从主从过程大概有3个步骤主将更改操作记录到binlog里从将主的binlog事件(s 阅读全文
posted @ 2019-06-20 18:37 ritchy 阅读(546) 评论(0) 推荐(0)
摘要:先查看下,把MySQL停下来查看进程状态ps -ef | grep mysql查看mysql服务状态service mysqld status停止mysql服务service mysqld stop 检查是否安装MySQL[root@rdtest ~]# rpm -qa | grep -i mysq 阅读全文
posted @ 2019-06-18 17:01 ritchy 阅读(281) 评论(0) 推荐(1)
摘要:清除yum缓存 yum clean all 重新安装,见结尾[root@localhost ~]# yum install libstdc++.so.6Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * 阅读全文
posted @ 2019-06-03 14:46 ritchy 阅读(1972) 评论(0) 推荐(1)
摘要:转自 https://blog.51cto.com/tongcheng/1710265以下参数是在mysql-5.6.27中使用,可能mysql版本不同使用方法不一样1.线程参数innodb_read_io_threads=6 --innodb存储引擎读线程数,供客户端读取数据,默认值是4innod 阅读全文
posted @ 2019-05-29 16:53 ritchy 阅读(385) 评论(0) 推荐(0)
摘要:innodb存储引擎监控分为四种,表监控,表空间监控,锁监控,状态监控.可以在mysql客户端开启监控选项,然后信息将会输出在mysql的错误日志内.innodb_monitor和innodb_lock_monitor会每隔15秒会向错误日志中记录InnoDB监控信息,innodb_table_mo 阅读全文
posted @ 2019-05-29 16:46 ritchy 阅读(412) 评论(0) 推荐(0)

1