技术开发 频道

ubuntu升级Mysql Server失败的解决办法

【IT168 技术文档】如升级mysql server遇到错误,错误信息如下:

Preparing to replace mysql-server-5.0 5.0.38-0ubuntu1 (using .../mysql-server-5.0_5.0.45-1ubuntu2_i386.deb) ...
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: warning - old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/mysql-server-5.0_5.0.45-1ubuntu2_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
* Starting MySQL database server mysqld [ OK ]
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.0_5.0.45-1ubuntu2_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


解决办法:

sudo cat /var/run/mysqld/mysqld.pid #获得mysql server的运行ID,填入下方kill后的 xxx
sudo kill xxx #'xxx'为上方的输出结果
 

再重新升级mysql server.
0
相关文章