mysql 彻底删除

mysql 彻底删除

我弄坏了我的 mysql,现在我想完全重新安装它。我试过:

$ sudo apt-get install --reinstall mysql-server
$ sudo apt-get remove --purge mysql-client mysql-server

但我总是看到弹出窗口建议更改 root 密码,我更改了密码,然后收到一条错误消息,说我可以更改它。

$ sudo apt-get remove --purge mysql-client mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package mysql-client is not installed, so not removed
Package mysql-server is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libmygpo-qt1 libqtscript4-network libqtscript4-gui libtag-extras1 libqtscript4-sql libqtscript4-xml
  amarok-utils amarok-common libqtscript4-uitools liblastfm0 libloudmouth1-0 libqtscript4-core
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.28-0ubuntu0.12.04.2) ...
121114 19:04:03 [Note] Plugin 'FEDERATED' is disabled.
121114 19:04:03 InnoDB: The InnoDB memory heap is disabled
121114 19:04:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121114 19:04:03 InnoDB: Compressed tables use zlib 1.2.3.4
121114 19:04:03 InnoDB: Initializing buffer pool, size = 128.0M
121114 19:04:03 InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
121114 19:04:03 InnoDB: Could not open or create data files.
121114 19:04:03 InnoDB: If you tried to add new data files, and it failed here,
121114 19:04:03 InnoDB: you should now edit innodb_data_file_path in my.cnf back
121114 19:04:03 InnoDB: to what it was, and remove the new ibdata files InnoDB created
121114 19:04:03 InnoDB: in this failed attempt. InnoDB only wrote those files full of
121114 19:04:03 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
121114 19:04:03 InnoDB: remove old data files which contain your precious data!
121114 19:04:03 [ERROR] Plugin 'InnoDB' init function returned error.
121114 19:04:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
121114 19:04:03 [ERROR] Unknown/unsupported storage engine: InnoDB
121114 19:04:03 [ERROR] Aborting

121114 19:04:03 [Note] /usr/sbin/mysqld: Shutdown complete

start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

我没有任何重要的数据库,这对我来说是件好事,但是......

编辑

$ sudo apt-get remove mysql-server
[sudo] password for teplyakov: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mysql-server
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 115 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 303491 files and directories currently installed.)
Removing mysql-server ...
Setting up mysql-server-5.5 (5.5.28-0ubuntu0.12.04.2) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

我特别困惑的是:

Removing mysql-server ...
Setting up mysql-server-5.5 (5.5.28-0ubuntu0.12.04.2) ...
start: Job failed to start

答案1

在这里我发现了一些对我有帮助的巫术技巧,也许对你也有用: https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/989353

我删除了以下软件包,然后重新安装了 mysql-server:

sudo apt-get --purge remove mysql-server-5.1 mysql-server-5.5
sudo apt-get install mysql-server

相关内容