{"id":6684,"date":"2022-04-13T01:23:03","date_gmt":"2022-04-12T19:53:03","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6684"},"modified":"2022-04-18T15:18:29","modified_gmt":"2022-04-18T09:48:29","slug":"how-to-change-my-sql-password-on-linux","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-change-my-sql-password-on-linux\/","title":{"rendered":"How to change My SQL password on Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Step1: Stopping the MySQL service by using this command <a href=\"https:\/\/linuxconfig.org\/how-to-use-systemctl-to-list-services-on-systemd-linux\" target=\"_blank\" rel=\"noreferrer noopener\">systemctl command<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#sudo systemctl stop mysql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step2: Now, we need to restart the MySQL service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#sudo mysqld_safe --skip-grant-tables<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step3: We have able to connect to the MySQL server as root, without specifying a password.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#mysql -u root<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step4: Now, reset the root password, but first flush the privileges to reload the grants.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql&gt; FLUSH PRIVILEGES;\nmysql&gt; use mysql;\nmysql&gt; update user set plugin=\"mysql_native_password\" where User='root';\nmysql&gt; ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password_here';\nmysql&gt; FLUSH PRIVILEGES;\nmysql&gt; quit;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step5: Finally, shut down the MySQL service and start it back up.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#sudo systemctl restart mysql<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Step1: Stopping the MySQL service by using this command systemctl command: Step2: Now, we need to restart the MySQL service. [&hellip;]<\/p>\n","protected":false},"author":496,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[],"class_list":["post-6684","post","type-post","status-publish","format-standard","hentry","category-web-architecture","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1JO","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/496"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6684"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6684\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}