menu

开发进行时...

crazy coder

Avatar

debian下mysql升级后出错解决

1、启动与关闭:
Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
这里的debian-sys-maint为启动与关闭mysql所需要的用户,相关设置在/etc/mysql/debian.cnf中
cat /etc/mysql/debian.cnf
得到debian-sys-maint的password
在mysql>下执行GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '你得到的password' WITH GRANT OPTION;
或都执行update user set password=password('你得到的password') where user='debian-sys-maint';
flush privileges;
然后执行
#/etc/init.d/mysql restart

2、如果有表损坏,报crash错误
/usr/bin/myisamchk -r /var/lib/mysql/mysql/报错的表.MYI
或/usr/bin/myisamchk -o /var/lib/mysql/mysql/报错的表.MYI

3、root密码不对或忘记密码
#kill `cat /var/run/mysqld/mysqld.pid`
#/usr/bin/mysqld_safe --skip-grant-tables &
root用户以空密码登录
在mysql>执行user mysql与update user set password=password('新密码') where user='root';
flush privileges;
然后/etc/init.d/mysql restart重新启动


评论已关闭