如何从 Ubuntu 14.04 删除 MySQL?

如何从 Ubuntu 14.04 删除 MySQL?

我尝试将我的数据目录移动到正在运行的 MySql 安装上,但显然我搞砸了。

我尝试卸载/重新安装多次,但重新安装时仍出现相同的错误。

mysql/error.log 给了我这个:

150118 11:54:44 [Note] Plugin 'FEDERATED' is disabled.
150118 11:54:44 InnoDB: The InnoDB memory heap is disabled
150118 11:54:44 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150118 11:54:44 InnoDB: Compressed tables use zlib 1.2.8
150118 11:54:44 InnoDB: Using Linux native AIO
150118 11:54:44 InnoDB: Initializing buffer pool, size = 128.0M
150118 11:54:44 InnoDB: Completed initialization of buffer pool
150118 11:54:44  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.

我已经尝试过 chowned 和 chmodded 直到脸色发青,但还是会得到相同的错误。我也关注了很多关于如何卸载 MySQL 的帖子,但重新安装时还是得到相同的结果。

尝试安装后我收到此错误:

Setting up mysql-server-5.5 (5.5.40-0ubuntu0.14.04.1) ...
150118 11:58:01 [Warning] Can't create test file /var/lib/mysql/yosemite.lower-test
150118 11:58:01 [Warning] Can't create test file /var/lib/mysql/yosemite.lower-test
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.5 (--configure):
  subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

MySQL 是 /var/lib/mysql/ 的所有者,并且文件权限应该允许写入。

我不需要保留任何数据库,我只需要杀死这个东西并重新安装并运行它!

如能得到任何帮助我们将非常感激,提前谢谢!

读写

答案1

我已经卸载了 MySQL,然后重新安装,对此我仍感到很纠结。

解决方案很简单。我确信我是在试图弄清楚这个问题的过程中执行了这些操作的,但对于任何寻找解决方案的人来说,这就是我所做的:

清除 mysql-server-5.1 和 mysql-common。
然后,删除 /var/lib/mysql /etc/mysql 和 /var/log/mysql。
然后我重新启动了机器。

来源:http://ubuntuforums.org/showthread.php?t=1407998&p=9332936#post9332936

再次,我不确定为什么现在这个方法有效,因为我已经在其他尝试中完成了所有步骤,但我不会对礼物吹毛求疵。希望其他人觉得这个有用。

相关内容