---
title: "Ubuntu下彻底卸载重装mysql"
author: "stephen830"
date: "2014-12-05T16:03:11Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-mysql"
draft: false
lastmod: "2014-12-05T16:03:11Z"
id: 2163611
url: "https://stephen830.iteye.com/blog/2163611"
---

Ubuntu下彻底卸载重装mysql

原文链接：

http://www.blogjava.net/yjhmily/articles/336926.html

做个记录：

1、删除 mysql

1 sudo apt-get autoremove --purge mysql-server-5.0  
2 sudo apt-get remove mysql-server  
3 sudo apt-get autoremove mysql-server  
4 sudo apt-get remove mysql-common (非常重要)  
上面的其实有一些是多余的，建议还是按照顺序执行一遍

清理残留数据

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P