{"id":106,"date":"2016-06-20T06:46:23","date_gmt":"2016-06-20T06:46:23","guid":{"rendered":"https:\/\/www.hostingahead.com\/blog\/?p=106"},"modified":"2016-06-20T06:46:23","modified_gmt":"2016-06-20T06:46:23","slug":"reinstall-mysql-ubuntu-broken-previous-installation","status":"publish","type":"post","link":"https:\/\/www.hostingahead.com\/blog\/reinstall-mysql-ubuntu-broken-previous-installation\/","title":{"rendered":"Reinstall MySQL on Ubuntu on  a broken previous installation"},"content":{"rendered":"<p><strong>Scenario: <\/strong><\/p>\n<p>Mysql was removed by a user without knowing what he was doing. He tried to install it again and not sure what all steps he followed.<\/p>\n<p>If you try to install you will face below problem<\/p>\n<ol>\n<li>you cannot set MySQL root password<\/li>\n<li>MySQL will not be started after installation<\/li>\n<li>you will see MySQL dependencies errors<\/li>\n<\/ol>\n<p><strong>When I tried to install the packages I got below error message. <\/strong><\/p>\n<p>MySQL: Can&#8217;t create\/write to file &#8216;\/tmp********************<\/p>\n<blockquote><p>dpkg: error processing package mysql-server-5.5 (&#8211;configure):<br \/>\nsubprocess installed post-installation script returned error exit status 1<br \/>\ndpkg: dependency problems prevent configuration of mysql-server:<br \/>\nmysql-server depends on mysql-server-5.5; however:<br \/>\nPackage mysql-server-5.5 is not configured yet.<\/p>\n<p>start: Job failed to start<br \/>\ninvoke-rc.d: initscript mysql, action &#8220;start&#8221; failed.<br \/>\ndpkg: error processing package mysql-server-5.5 (&#8211;configure):<br \/>\nsubprocess installed post-installation script returned error exit status 1<br \/>\ndpkg: dependency problems prevent configuration of mysql-server:<br \/>\nmysql-server depends on mysql-server-5.5; however:<br \/>\nPackage mysql-server-5.5 is not configured yet.<\/p>\n<p>dpkg: error processing package mysql-server (&#8211;configure):<br \/>\ndependency problems &#8211; leaving unconfigured<br \/>\nNo apport report written because the error message indicates its a followup error from a previous failure.<br \/>\nErrors were encountered while processing:<br \/>\nmysql-server-5.5<br \/>\nmysql-server<\/p><\/blockquote>\n<p><strong>Solution<\/strong><\/p>\n<p>1)\u00a0 Make sure \/tmp folder has correct permission (1777 )<\/p>\n<p>2) Remove MySQL and clean up folders<\/p>\n<blockquote><p>sudo apt-get remove &#8211;purge mysql-server mysql-client mysql-common mysql-server-5.5 mysql-client-5.5 mysql-server-core-5.5 mysql-client-core-5.5<br \/>\nsudo apt-get autoremove<br \/>\nsudo apt-get autoclean`<br \/>\nsudo rm -rf \/var\/lib\/mysql \/etc\/mysql\u00a0 ( <strong>you should take a copy of this folder if you have any database on the server<\/strong> )<br \/>\nsudo deluser mysql<\/p><\/blockquote>\n<p>3) Install MySQL Now<\/p>\n<blockquote><p>sudo apt-get install mysql-server-5.5<br \/>\nsudo apt-get install mysql-server<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Scenario: Mysql was removed by a user without knowing what he was doing. He tried to install it again and not sure what all steps he followed. If you try to install you will face below problem you cannot set MySQL root password MySQL will not be started after installation you will see MySQL dependencies &#8230;<\/p>\n","protected":false},"author":101012,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[19],"_links":{"self":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/106"}],"collection":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/users\/101012"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":2,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/posts\/106\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostingahead.com\/blog\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}