1、
MySQL错误日志里出现:
140331 10:08:18 [ERROR] Error reading master configuration
140331 10:08:18 [ERROR] Failed to initialize the master info structure
140331 10:08:18 [Note] Event Scheduler: Loaded 0 events
从错误提示就可以看出和mster info相关,找到数据目录下的master.info文件,直接cat查看
# cat master.info
18
luocs-mysql-
bin.000004
267
1.1.1.1
rep1
PASSWORD
3306
60
0
0
1800.000
0
可以看出格式不对,解决方法非常简单,reset slave即可,这样将会清空master.info文件,错误也将消失。
———————————————————————————————————————————————————————–
2、
MySQL 往一张大表添加字段时报如下错误:
ERROR 1799 (HY000) at line 1: Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
解决方法:
我的数据库为MySQL 5.5版本,innodb_online_alter_log_max_size值为默认大小128M。
mysql> show variables like 'innodb_online_alter_log_max_size';
+——————————————+———————-+
| Variable_name | Value |
+——————————————+———————-+
| innodb_online_alter_log_max_size | 134217728 |
+——————————————+———————-+
1 rows in set (0.00 sec)
该参数为动态参数且全局的,可通过如下命令加大
mysql> set global innodb_online_alter_log_max_size=402653184;
Query OK, 0 rows affected (0.03 sec)
加到合适大小,我往120G大小表里添加字段设置该值4G,成功执行。
———————————————————————————————————————————————————————–
3、
MySQL日志:
140306 12:03:25 InnoDB: ERROR: the age of the last checkpoint is 9434024,
InnoDB: which exceeds the log group capacity 9433498.
InnoDB: If you are using big BLOB or TEXT rows, you must set the
InnoDB: combined size of log files at least 10 times bigger than the
InnoDB: largest such row.
应该是Innodb引擎下日志大小设置过小导致的,某个事物产生大量日志,但innodb_log_file_size设置过小,可以加大解决。
解决方法:
直接贴网上找到的方法,如下
STEP 01) Change the following in /etc/my.cnf
[mysqld]
innodb_log_buffer_size = 32M
innodb_buffer_pool_size = 3G
innodb_log_file_size = 768M
STEP 02) mysql -uroot -p -e"SET GLOBAL innodb_fast_shutdown = 0;"
STEP 03) service mysql stop
STEP 04) rm -f /var/lib/mysql/ib_logfile*
STEP 05) service mysql start
I added SET GLOBAL innodb_fast_shutdown = 0;. What does that do? It forces InnoDB to completely purge transactional changes from all of InnoDB moving parts, including the transactional logs (ib_logfile0, ib_logfile1). Thus, there is no need to backup the old ib_logfile0, ib_logfile1. If deleting them makes you nervous, then make Step 04
mv /var/lib/mysql/ib_logfile* ..
———————————————————————————————————————————————————————–
4、
使用pt-online-schema-change工具添加字段时,收到错误如下:
# pt-online-schema-change –alter="add column tag_common text default null" –user=root –password=xxxxxxxx D=MYDB,t=MYTB –execute
Cannot connect to D=lsedata_13Q1,h=10.13.7.47,p=…,u=root
No slaves found. See –recursion-method if host BJL1-Y13-10-ops.gaoder.net has slaves.
Not checking slave lag because no slaves were