MYSQL Error Collection
远程tcp登录时报错:
ERROR 1130 (00000): Host 'RHELMYSQL' is not allowed to connect to this MySQL
解决方案:
修改user表中host值
use mysql
1. select host,user from user;(确保有host为%,用户为root的记录)
2. grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
3. flush privileges;
设置远程tcp登录后,本地登录报错
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password)
解决方案:
use mysql
1. select host,user from user;(确保有host为localhost,用户为root的记录)
2. grant all privileges on *.* to 'root'@'localhost' identified by '123456' with grant option;
3. flush privileges;
导入数据报错:
1558 - Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50018, now running 50146. Please use mysql_upgrade to fix this error.
解决方案:
cd /usr/local/mysql/bin
./mysql_upgrade -uroot -pxxxxx --datadir=/usr/local/mysql --basedir=/var/lib/mysql
主从同步报错:
Last_IO_Error: Got a packet bigger than 'max_allowed_packet' bytes
解决方案:
1. 查看主库my.cnf文件中关键字:max_allowed_packet
2. 查看备库my.cnf文件中关键字:max_allowed_packet
3. 对比区别,修改成一样的。
4. 重启备库。
数据库关闭后报错:mysql dead but subsys locked:
1. 删除文件:rm -rf /var/lock/subsys/mysqld
2. 启动
如果不行,检查本机是否存在多个mysql
Comments
Post a Comment