不定期更新MySQL错误问题
MySQL 启动问题修复
-
问题: MySQL 使用xtrabackup 还原后启动报错
[ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
-
解决:
在
/etc/my.cnf
中修改或增加innodb_data_file_path=ibdata1:10M:autoextend
计算方式:640页*16K/页 / 1024K/M = 10M
-
问题:
mysql.user table is damaged. Please run mysql_upgrade.
-
解决:
删除data 目录下的所有东西,使用
mysqld --initialize --user=mysql
命令初始化系统,保证系统能正常启动。
-
问题: 忘记管理员密码,重置密码,mysql登录及密码修改
出现
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
提示不能正常登录 -
解决:
# 安全启动mysql $ mysqld_safe –user=mysql –skip-grant-tables –skip-networking & # 登录进MySQL $ mysql # 修改密码 mysql> update user set authentication_string=PASSWORD(‘root’) where user=’root’; Query OK, 1 row affected, 1 warning (0.04 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec) # 重启mysql,提示重新修改密码 mysql> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. # 修改密码 mysql> set PASSWORD=Password('root'); Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> alter user root@localhost PASSWORD EXPIRE NEVER; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.01 sec)
-
问题: 跨版本MySQL导入数据报错
描述: 准备搭建主从,主MySQL 版本
5.7.9
, 从库版本5.7.22
, 在MySQL 5.7.9
使用mysqldump
备份出数据,在从库恢复数据,执行CHANGE MASTER TO ....
报错,执行reset slave
报错:ERROR 1805 (HY000): Column count of mysql.slave_master_info is wrong. Expected 25, found 24. The table is probably corrupted
-
解决
实用
mysql_upgrate
升级系统表mysql_upgrate -uroot -p -S /var/run/mysql.sock