您的位置:首页 > 数据库 > MySQL

mysql 常见问题(待续)

2010-06-27 15:50 281 查看
一 unknown option '--skip-federated'
mysql 安装或者启动时,出错 unknown option '--skip-federated'

解决的方法是:
1、vi /etc/my.cnf
#skip-federated 将此行注释掉
即可。
2、或者编译的时候加上如下参数:
--with-plugins=all

二 mysql 从同步故障
1.查看从状态时(show slave status\G)
[ERROR] Slave SQL: Error 'Duplicate entry '1007-443786-0' for key
或者Error 'Table 'xxx' already exists'

选择跳过
stop slave;
set global sql_slave_skip_counter=1; (1是指跳过一个错误)
slave start;

2.查看从状态时(show slave status\G)
Last_Error: Query partially completed on the master (error on master: 1317) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; . Query: 'delete from t_recordlist where trainingid = 101'

解决
mysql> stop slave;
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
mysql> start slave;

3.
启动时,mysql日志提示
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 268435456 bytes!
配置文件定义的innodb_log_file_size = 256M 与当前的文件大小不一致
可以忽略此错误
或者将当前的重命名,重启mysql,重新按照配置文件的大小重新生成新的log

三 mysql启动了,输入mysql无法登录,提示密码错误
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

这种一般是rpm安装的mysql
这种情况下要求主机名不能是localhost
否则安装时会提示
ERROR: 1062 Duplicate entry 'localhost-' for key 1
100623 14:36:08 [ERROR] Aborting

100623 14:36:08 [Note] /usr/sbin/mysqld: Shutdown complete

Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/sbin/mysqld --skip-grant &
虽然此时启动是成功的,但是user表里面是空的,所以导致无法验证登录

解决办法就是将主机名改名,然后再装rpm包
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息