{"id":752,"date":"2011-07-18T11:05:08","date_gmt":"2011-07-18T16:05:08","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=752"},"modified":"2011-08-09T08:43:42","modified_gmt":"2011-08-09T13:43:42","slug":"reset-mysql-password","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2011\/07\/reset-mysql-password\/","title":{"rendered":"Reset MySQL Password"},"content":{"rendered":"<p>I setup a LAMP server for a developer a while back and he changed the passwords for root and the root mysql user to something besides my defaults.  So when he asked me to give him the password for the database, I could not really help him out.  Or could I?<\/p>\n<p>Stop the mysql services:<br \/>\n<code>\/etc\/init.d\/mysql stop<\/code><\/p>\n<p>Start mysql without the passwords:<br \/>\n<code>mysqld_safe --skip-grant-tables &<\/code><\/p>\n<p>Connect to the safe mysql:<br \/>\n<code>mysql -u root<\/code><\/p>\n<p>Set a new root password:<br \/>\n<code>use mysql;<\/code><br \/>\n<code>update user set password=PASSWORD(\"your_New_Password_here\") where User='root';<\/code><br \/>\n<code>flush privileges;<\/code><br \/>\n<code>quit<\/code><\/p>\n<p>Stop the safe mysql database:<br \/>\n<code>\/etc\/init.d\/mysql stop<\/code><\/p>\n<p>Start mysql and test:<br \/>\n<code>\/etc\/init.d\/mysql start<\/code><br \/>\n<code>mysql -u root -pYOURNEWPASSWORDHERE<\/code><\/p>\n<p>*note &#8211; there is no space between -p and your password.<\/p>\n<p>AND, in case you&#8217;re just wanting to change the password of a known user:<br \/>\n<code>mysqladmin -u root -pOLDPASSWORD password NEWPASSWORD<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I setup a LAMP server for a developer a while back and he changed the passwords for root and the root mysql user to something besides my defaults. So when he asked me to give him the password for the database, I could not really help him out. Or could I? Stop the mysql services: &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2011\/07\/reset-mysql-password\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Reset MySQL Password<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-752","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=752"}],"version-history":[{"count":2,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/752\/revisions"}],"predecessor-version":[{"id":770,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/752\/revisions\/770"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}