MySQL断电,出现 Error 1236
今天几台MySQL服务器突然停电,重启后复制无法启动,总是报如下错误:080922 10:29:01 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000778' at position 2874108, relay log './relay-bin.003287' position: 2874245080922 10:29:01 [Note] Slave I/O thread: connected to master 'replication@192.168.0.10:3306', replication started in log 'mysql-bin.000778' at position 2874108080922 10:29:01 [ERROR] Error reading packet from server: Client requested master to start replication fro
UPDATE 时主键冲突引发的思考(链接)
http://imysql.cn/2008_06_17_sth_about_update_duplicate_key原来mysql在update时也可以order by,学习了。。[@more@]
MySQL主从复制中关于AUTO_INCREMENT的奇怪问题
昨天修改一个表的字段,发现主从复制同步失效了,但同步进程没有出错,mysql日志也没有出错,仔细查找了一下原因,发现是新增的自增主键字段的起始值在主从库上不一致,导致按主键更新数据时无法在从库找到对应记录。事情经过如下:[@more@]表table1(主库为innodb类型,从库为MyISAM类型),有一自增主键pid,现将pid改成非自增,非主键,另外增加一自增主键。alter table table1 modify pid int not null;alter talbe table1 drop primary key;alter table table1 add aid int not null auto_increment primary key first;结果主库上表t