mysql卸载重新安装文档
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
卸载mysql报错解决方法1
dpkg: error processing mysql-server (--configure): dependency problems - leaving unconfigured 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
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 mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previou s failure.
Errors were encountered while proces sing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
解决方法:
删除mysql前先删除一下 /var/lib/mysql 还有 /etc/mysql
sudo rm /var/lib/mysql/ -R
sudo rm /etc/mysql/ -R
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor
sudo apt-get install mysql-server mysql-common
UBUNTU 彻底删除MYSQL 然后重装MYSQL
删除mysql
sudo apt-get autoremove --purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremovemysql-server
sudo apt-get remove mysql-common //这个很重要
上面的其实有一些是多余的。
清理残留数据
dpkg -l |grep ^rc|awk '{print $2}' |sudoxargsdpkg -P
安装mysql
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// 安装php5-mysql 是将php和mysql连接起来
一旦安装完成,MySQL 服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务器是否正在运行:
sudonetstat -tap | grepmysql
当您运行该命令时,您可以看到类似下面的行:
tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
如果服务器不能正常运行,您可以通过下列命令启动它:
sudo /etc/init.d/mysql restart
进入mysql
$mysql -uroot -p 管理员密码
配置MySQL 的管理员密码:
sudomysqladmin -u root password newpassword