{"id":92,"date":"2008-12-23T21:18:00","date_gmt":"2008-12-23T21:18:00","guid":{"rendered":"http:\/\/gistlabs.net\/weblogs\/?p=92"},"modified":"2008-12-23T21:18:00","modified_gmt":"2008-12-23T21:18:00","slug":"how-to-change-the-mysql-users-and-root-password","status":"publish","type":"post","link":"https:\/\/www.gistlabs.net\/weblogs\/how-to-change-the-mysql-users-and-root-password\/","title":{"rendered":"How to change the Mysql users and root password"},"content":{"rendered":"<p>There are two way to change the mysql user and root password<\/p>\n<p>mysqladmin<br \/>\nIf you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:<\/p>\n<p>$ mysqladmin -u root password NEWPASSWORD<\/p>\n<p>However, if you want to change (or update) a root password, then you need to use following command<\/p>\n<p>$ mysqladmin -u root -p oldpassword newpass<\/p>\n<p>Enter password:<br \/>\nChange MySQL password for other user<\/p>\n<p>To change a normal user password you need to type (let us assume you would like to change password for nikesh):<\/p>\n<p>$ mysqladmin -u nikesh -p oldpassword newpass<\/p>\n<p>Changing MySQL root user password using mysql sql command<br \/>\nThis is another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method to update or change password for user vivek:<\/p>\n<p>1) Login to mysql server, type following command at shell prompt:<\/p>\n<p>$ mysql -u root -p<\/p>\n<p>2) Use mysql database (type command at mysql prompt):<\/p>\n<p>mysql> use mysql;<\/p>\n<p>3) Change password for user nikesh:<\/p>\n<p>mysql> update user set password=PASSWORD(&#8220;NEWPASSWORD&#8221;) where User=&#8217;nikesh&#8217;;<\/p>\n<p>4) Reload privileges:<\/p>\n<p>mysql>  flush privileges;<br \/>\nmysql> quit<\/p>\n<p>source : <a href=\"http:\/\/linuxpoison.blogspot.com\/\">http:\/\/linuxpoison.blogspot.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are two way to change the mysql user and root password mysqladmin If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows: $ mysqladmin -u root &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/www.gistlabs.net\/weblogs\/how-to-change-the-mysql-users-and-root-password\/\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-unix","item-wrap"],"_links":{"self":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":0,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gistlabs.net\/weblogs\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}