mysql 常見問題(待續)

一 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包


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章