转载本站文章请注明,转载自: 月影鹏鹏 [http://Jacky.Aiwaly.com]
本文链接: http://jk.aiwaly.com/wp/debian%e4%b8%8bmysql-server%e7%9a%84%e4%b8%80%e4%b8%aa%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3-2.html
$sudo /etc/init.d/mysql start
Starting MySQL database server: mysqld . . ..
Checking for corrupt, not cleanly closed and upgrade needing tables..
/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘debian-sys-maint’@'localhost’ (using password: YES)’
那么这时候可以去/etc/mysql/debian.cnf,找到里面的password
然后登录到mysql shell:
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘debian-sys-maint’@'localhost’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
mysql> flush privileges;
七中的就是上面找到的password
然后
$sudo /etc/init.d/mysql restart