{"id":1601,"date":"2022-11-29T15:08:02","date_gmt":"2022-11-29T08:08:02","guid":{"rendered":"https:\/\/longvan.net\/cong-dong\/?p=1601"},"modified":"2022-11-29T15:08:02","modified_gmt":"2022-11-29T08:08:02","slug":"huong-dan-reset-password-mysql8","status":"publish","type":"post","link":"https:\/\/longvan.net\/cong-dong\/huong-dan-reset-password-mysql8\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn reset password MYSQL8"},"content":{"rendered":"<p>MYSQL l\u00e0 m\u1ed9t h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u r\u1ea5t ph\u1ed5 bi\u1ebfn, \u0111\u1eb7c bi\u1ec7t l\u00e0 \u0111\u1ed1i v\u1edbi c\u00e1c m\u00e1y ch\u1ee7 ch\u1ea1y d\u1ecbch v\u1ee5 web. Trong b\u00e0i vi\u1ebft n\u00e0y, Long V\u00e2n s\u1ebd h\u01b0\u1edbng d\u1eabn Qu\u00fd kh\u00e1ch c\u00e1ch reset l\u1ea1i password cho MYSQL phi\u00ean b\u1ea3n 8.0. C\u00e1c b\u01b0\u1edbc c\u1ee5 th\u1ec3 nh\u01b0 sau:<\/p>\n<ol>\n<li><strong>B\u01b0\u1edbc 1: <\/strong>Ki\u1ec3m tra phi\u00ean b\u1ea3n MYSQL \u0111ang s\u1eed d\u1ee5ng b\u1eb1ng l\u1ec7nh\n<pre># mysqld -V<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1604 size-full\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled-1-e1669700013910.png\" alt=\"\" width=\"637\" height=\"76\" srcset=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled-1-e1669700013910.png 637w, https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled-1-e1669700013910-300x36.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><br \/>\nTheo h\u00ecnh, phi\u00ean b\u1ea3n MYSQL \u0111ang s\u1eed d\u1ee5ng l\u00e0 8.0.31<\/li>\n<li><strong>B\u01b0\u1edbc 2: T\u1ea1m d\u1eebng service MYSQL<\/strong> th\u1ef1c hi\u00ean l\u1ec7nh\n<pre><strong># <\/strong>systemctl stop mysql\n# systemctl status mysql ( ki\u1ec3m tra \u0111\u1ea3m b\u1ea3o tr\u1ea1ng th\u00e1i mysql \u0111\u00e3 stop).<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1605\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled1-1.png\" alt=\"\" width=\"636\" height=\"255\" srcset=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled1-1.png 636w, https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled1-1-300x120.png 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/li>\n<li><strong>B\u01b0\u1edbc 3: <\/strong>T\u1ea1o th\u01b0 m\u1ee5c ch\u1ee9a \/var\/run\/mysqld&#8217;. Sau \u0111\u00f3 ph\u00e2n quy\u1ec1n th\u01b0 m\u1ee5c v\u1eeba t\u1ea1o.<strong><br \/>\n<\/strong>B\u01b0\u1edbc n\u00e0y nh\u1eb1m tr\u00e1nh l\u1ed7i <em>\u201cIf mysqld_safe Directory &#8216;\/var\/run\/mysqld&#8217; for UNIX socket file don&#8217;t exists\u201d<br \/>\n<\/em><\/p>\n<pre># mkdir -p \/var\/run\/mysqld\n# chown mysql:mysql \/var\/run\/mysqld<\/pre>\n<\/li>\n<li><strong>B\u01b0\u1edbc 4: <\/strong>Ch\u1ea1y l\u1ea1i MYSQL v\u1edbi t\u00f9y ch\u1ecdn \u201c<strong>\u2013skip-grant-tables<\/strong>\u201d \u0111\u1ec3 ch\u1ea1y mysql m\u00e0 kh\u00f4ng c\u1ea7n root password.<strong><br \/>\n<\/strong><\/p>\n<pre># sudo mysqld_safe --skip-grant-tables &amp;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1606 size-full\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled2-e1669700393374.png\" alt=\"\" width=\"796\" height=\"142\" srcset=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled2-e1669700393374.png 796w, https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled2-e1669700393374-300x54.png 300w, https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled2-e1669700393374-768x137.png 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><\/li>\n<li><strong>B\u01b0\u1edbc 5: <\/strong>Ti\u1ebfn h\u00e0nh truy c\u1eadp l\u1ea1i MYSQL m\u00e0 kh\u00f4ng c\u00e2n password sau \u0111\u00f3 c\u00e0i \u0111\u1eb7t l\u1ea1i password m\u1edbi.<strong><br \/>\n<\/strong><\/p>\n<pre># mysql -u root\n&gt; UPDATE mysql.user SET authentication_string=null WHERE User='root';\n&gt; flush privileges;\n&gt; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_root_password';\n&gt; flush privileges;\n&gt; quit<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1607\" src=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled3.png\" alt=\"\" width=\"790\" height=\"451\" srcset=\"https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled3.png 790w, https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled3-300x171.png 300w, https:\/\/longvan.net\/cong-dong\/wp-content\/uploads\/2022\/11\/Untitled3-768x438.png 768w\" sizes=\"auto, (max-width: 790px) 100vw, 790px\" \/><\/li>\n<li><strong>B\u01b0\u1edbc 6: <\/strong>Kh\u1edfi \u0111\u1ed9ng l\u1ea1i MYSQL v\u00e0 ki\u1ec3m tra truy c\u1eadp v\u1edbi password v\u1eeba thi\u1ebft l\u1eadp<strong><br \/>\n<\/strong><\/li>\n<\/ol>\n<p>V\u1eady l\u00e0 m\u00ecnh \u0111\u00e3 h\u01b0\u1edbng d\u1eabn xong ph\u1ea7n reset password Mysql8 tr\u00ean h\u1ec7 \u0111i\u1ec1u h\u00e0nh Ubuntu 22.04. Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MYSQL l\u00e0 m\u1ed9t h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u r\u1ea5t ph\u1ed5 bi\u1ebfn, \u0111\u1eb7c bi\u1ec7t l\u00e0 \u0111\u1ed1i v\u1edbi c\u00e1c m\u00e1y ch\u1ee7 ch\u1ea1y d\u1ecbch v\u1ee5 web. Trong b\u00e0i vi\u1ebft n\u00e0y, Long V\u00e2n s\u1ebd h\u01b0\u1edbng d\u1eabn Qu\u00fd kh\u00e1ch c\u00e1ch reset l\u1ea1i password cho MYSQL phi\u00ean b\u1ea3n 8.0. C\u00e1c b\u01b0\u1edbc c\u1ee5 th\u1ec3 nh\u01b0 sau: B\u01b0\u1edbc 1: Ki\u1ec3m tra [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_oasis_is_in_workflow":0,"_oasis_original":0,"footnotes":""},"categories":[40],"tags":[5,150,170,169],"class_list":["post-1601","post","type-post","status-publish","format-standard","hentry","category-web-hosting","tag-linux","tag-mysql","tag-password","tag-reset-password"],"_links":{"self":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts\/1601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/comments?post=1601"}],"version-history":[{"count":4,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts\/1601\/revisions"}],"predecessor-version":[{"id":1641,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/posts\/1601\/revisions\/1641"}],"wp:attachment":[{"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/media?parent=1601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/categories?post=1601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/longvan.net\/cong-dong\/wp-json\/wp\/v2\/tags?post=1601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}