{"id":79135,"date":"2024-09-30T11:56:24","date_gmt":"2024-09-30T04:56:24","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=79135"},"modified":"2024-09-30T11:56:24","modified_gmt":"2024-09-30T04:56:24","slug":"cach-cai-dat-mysql-tren-ubuntu","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/","title":{"rendered":"MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#MySQL_la_gi\" >MySQL l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Ubuntu_la_gi\" >Ubuntu l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Dieu_kien_de_cai_dat_MySQL_tren_Ubuntu\" >\u0110i\u1ec1u ki\u1ec7n \u0111\u1ec3 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Cach_cai_dat_MySQL_tren_Ubuntu_su_dung_goi_apt_tu_terminal\" >C\u00e1ch c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu s\u1eed d\u1ee5ng g\u00f3i apt t\u1eeb terminal<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Cai_dat_MySQL_tren_Ubuntu_tu_trang_chu_MySQL\" >C\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu t\u1eeb trang ch\u1ee7 MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Mot_so_thao_tac_khac_trong_MySQL\" >M\u1ed9t s\u1ed1 thao t\u00e1c kh\u00e1c trong MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Cau_hinh_Nang_cao_MySQL_Toi_uu_hoa_Hieu_suat_May_chu\" >C\u1ea5u h\u00ecnh N\u00e2ng cao MySQL: T\u1ed1i \u01b0u h\u00f3a Hi\u1ec7u su\u1ea5t M\u00e1y ch\u1ee7<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Cau_hoi_thuong_gap_ve_Cai_dat_MySQL_tren_Ubuntu\" >C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 C\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#Tong_ket_Cai_dat_MySQL_tren_Ubuntu\" >T\u1ed5ng k\u1ebft C\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/a><\/li><\/ul><\/nav><\/div>\n<p><em><strong>MySQL l\u00e0 m\u1ed9t trong nh\u1eefng h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u1ed5 bi\u1ebfn nh\u1ea5t, \u0111\u01b0\u1ee3c bi\u1ebft \u0111\u1ebfn v\u1edbi s\u1ef1 \u1ed5n \u0111\u1ecbnh, t\u00ednh linh ho\u1ea1t v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng. Khi k\u1ebft h\u1ee3p v\u1edbi Ubuntu, m\u1ed9t h\u1ec7 \u0111i\u1ec1u h\u00e0nh m\u00e3 ngu\u1ed3n m\u1edf m\u1ea1nh m\u1ebd, b\u1ea1n s\u1ebd c\u00f3 m\u1ed9t m\u00f4i tr\u01b0\u1eddng l\u00e0m vi\u1ec7c hi\u1ec7u qu\u1ea3, ti\u1ec7n l\u1ee3i cho vi\u1ec7c qu\u1ea3n l\u00fd d\u1eef li\u1ec7u. \u0110\u1ec3 t\u1eadn d\u1ee5ng h\u1ebft s\u1ef1 ti\u1ec7n d\u1ee5ng n\u00e0y, b\u01b0\u1edbc \u0111\u1ea7u ti\u00ean ch\u00fang ta c\u1ea7n l\u00e0m l\u00e0 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu.<\/strong><\/em><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u0110i\u1ec1u ki\u1ec7n \u0111\u1ec3 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1ch c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00e1ch c\u1ea5u h\u00ecnh n\u00e2ng cao\u00a0<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"MySQL_la_gi\"><\/span><b>MySQL l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Nh\u1eafc t\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u m\u00e3 ngu\u1ed3n m\u1edf, ng\u01b0\u1eddi ta ngh\u0129 ngay t\u1edbi MySQL &#8211; m\u1ed9t trong nh\u1eefng h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay. MySQL \u0111\u00e3 v\u00e0 \u0111ang tr\u1edf th\u00e0nh l\u1ef1a ch\u1ecdn \u01b0u ti\u00ean c\u1ee7a nhi\u1ec1u t\u1ed5 ch\u1ee9c, t\u1eeb c\u00e1c doanh nghi\u1ec7p v\u1eeba v\u00e0 nh\u1ecf \u0111\u1ebfn c\u00e1c t\u1eadp \u0111o\u00e0n l\u1edbn, nh\u1edd v\u00e0o nhi\u1ec1u \u01b0u \u0111i\u1ec3m n\u1ed5i b\u1eadt v\u1edbi kh\u1ea3 n\u0103ng x\u1eed l\u00fd nhanh ch\u00f3ng, \u0111\u1ed9 tin c\u1eady cao, d\u1ec5 s\u1eed d\u1ee5ng. N\u00f3 h\u1ed7 tr\u1ee3 nhi\u1ec1u lo\u1ea1i d\u1eef li\u1ec7u kh\u00e1c nhau v\u00e0 cho ph\u00e9p th\u1ef1c hi\u1ec7n c\u00e1c truy v\u1ea5n ph\u1ee9c t\u1ea1p, gi\u00fap ng\u01b0\u1eddi d\u00f9ng qu\u1ea3n l\u00fd v\u00e0 thao t\u00e1c d\u1eef li\u1ec7u m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">MySQL th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong c\u00e1c \u1ee9ng d\u1ee5ng y\u00eau c\u1ea7u c\u01a1 s\u1edf d\u1eef li\u1ec7u nh\u01b0 h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd n\u1ed9i dung, th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed v\u00e0 c\u00e1c trang web \u0111\u1ed9ng. Ngo\u00e0i ra, MySQL c\u0169ng l\u00e0 m\u1ed9t ph\u1ea7n quan tr\u1ecdng trong b\u1ed9 LAMP (Linux, Apache, MySQL, PHP\/Python\/Perl), m\u1ed9t n\u1ec1n t\u1ea3ng ph\u1ed5 bi\u1ebfn v\u00e0 \u0111\u00e1ng tin c\u1eady cho vi\u1ec7c ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng web.<\/span><\/p>\n<blockquote><p><em>\u0110\u1ecdc th\u00eam: <a href=\"https:\/\/itviec.com\/blog\/mysql-la-gi\/\" target=\"_blank\" rel=\"noopener\"><strong>MySQL l\u00e0 g\u00ec? T\u1ed5ng h\u1ee3p ki\u1ebfn th\u1ee9c MySQL \u0111\u1ea7y \u0111\u1ee7 v\u00e0 d\u1ec5 hi\u1ec3u<\/strong><\/a><\/em><\/p><\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"Ubuntu_la_gi\"><\/span><b>Ubuntu l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Ubuntu l\u00e0 m\u1ed9t trong nh\u1eefng h\u1ec7 \u0111i\u1ec1u h\u00e0nh Linux ph\u1ed5 bi\u1ebfn nh\u1ea5t tr\u00ean th\u1ebf gi\u1edbi v\u00e0 d\u1ef1a tr\u00ean b\u1ea3n ph\u00e2n ph\u1ed1i Debian &#8211; m\u1ed9t b\u1ea3n ph\u00e2n ph\u1ed1i (distribution) Linux n\u1ed5i ti\u1ebfng . Ubuntu n\u1ed5i ti\u1ebfng v\u1edbi t\u00ednh \u1ed5n \u0111\u1ecbnh cao, b\u1ea3o m\u1eadt v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng, \u0111i\u1ec1u n\u00e0y l\u00e0m cho n\u00f3 tr\u1edf th\u00e0nh m\u1ed9t l\u1ef1a ch\u1ecdn l\u00fd t\u01b0\u1edfng cho c\u1ea3 ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u v\u00e0 c\u1ea3 nh\u1eefng ng\u01b0\u1eddi d\u00f9ng chuy\u00ean nghi\u1ec7p.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 cung c\u1ea5p m\u1ed9t tr\u1ea3i nghi\u1ec7m ng\u01b0\u1eddi d\u00f9ng th\u00e2n thi\u1ec7n, Ubuntu cung c\u1ea5p m\u1ed9t kho \u1ee9ng d\u1ee5ng phong ph\u00fa, h\u1ed7 tr\u1ee3 m\u1ea1nh m\u1ebd cho ph\u1ea7n c\u1ee9ng v\u00e0 kh\u1ea3 n\u0103ng t\u00f9y bi\u1ebfn cao. Ngo\u00e0i ra, Ubuntu c\u0169ng th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng l\u00e0m h\u1ec7 \u0111i\u1ec1u h\u00e0nh cho c\u00e1c m\u00e1y ch\u1ee7, m\u00e1y t\u00ednh \u0111\u1ec3 b\u00e0n v\u00e0 c\u00e1c thi\u1ebft b\u1ecb IoT nh\u1edd kh\u1ea3 n\u0103ng qu\u1ea3n l\u00fd hi\u1ec7u qu\u1ea3 v\u00e0 b\u1ea3o m\u1eadt t\u1ed1t.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Khi l\u1ef1a ch\u1ecdn h\u1ec7 \u0111i\u1ec1u h\u00e0nh \u0111\u1ec3 c\u00e0i \u0111\u1eb7t MySQL, Ubuntu th\u01b0\u1eddng \u0111\u01b0\u1ee3c coi l\u00e0 m\u1ed9t trong nh\u1eefng l\u1ef1a ch\u1ecdn h\u00e0ng \u0111\u1ea7u v\u00ec m\u1ed9t s\u1ed1 \u01b0u \u0111i\u1ec3m sau:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Mi\u1ec5n ph\u00ed v\u00e0 m\u00e3 ngu\u1ed3n m\u1edf<\/b><span style=\"font-weight: 400;\">: Ubuntu l\u00e0 m\u1ed9t h\u1ec7 \u0111i\u1ec1u h\u00e0nh mi\u1ec5n ph\u00ed, m\u00e3 ngu\u1ed3n m\u1edf, cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng t\u1ef1 do s\u1eed d\u1ee5ng, ch\u1ec9nh s\u1eeda v\u00e0 ph\u00e2n ph\u1ed1i m\u00e0 kh\u00f4ng c\u1ea7n lo ng\u1ea1i v\u1ec1 chi ph\u00ed b\u1ea3n quy\u1ec1n.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ed7 tr\u1ee3 l\u00e2u d\u00e0i (LTS &#8211; Long-Term Support)<\/b><span style=\"font-weight: 400;\">: C\u00e1c phi\u00ean b\u1ea3n LTS c\u1ee7a Ubuntu cung c\u1ea5p s\u1ef1 \u1ed5n \u0111\u1ecbnh v\u00e0 c\u1eadp nh\u1eadt b\u1ea3o m\u1eadt trong th\u1eddi gian d\u00e0i (th\u01b0\u1eddng l\u00e0 5 n\u0103m), \u0111\u1ea3m b\u1ea3o t\u00ednh li\u00ean t\u1ee5c cho c\u00e1c d\u1ef1 \u00e1n v\u00e0 \u1ee9ng d\u1ee5ng quan tr\u1ecdng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>C\u1ed9ng \u0111\u1ed3ng l\u1edbn m\u1ea1nh<\/b><span style=\"font-weight: 400;\">: Ubuntu c\u00f3 m\u1ed9t c\u1ed9ng \u0111\u1ed3ng ng\u01b0\u1eddi d\u00f9ng v\u00e0 l\u1eadp tr\u00ecnh vi\u00ean l\u1edbn, lu\u00f4n s\u1eb5n s\u00e0ng cung c\u1ea5p s\u1ef1 h\u1ed7 tr\u1ee3 v\u00e0 t\u00e0i li\u1ec7u phong ph\u00fa.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>B\u1ea3o m\u1eadt cao<\/b><span style=\"font-weight: 400;\">: Ubuntu cung c\u1ea5p c\u00e1c b\u1ea3n c\u1eadp nh\u1eadt b\u1ea3o m\u1eadt th\u01b0\u1eddng xuy\u00ean, bao g\u1ed3m c\u1ea3 MySQL, gi\u00fap b\u1ea3o v\u1ec7 d\u1eef li\u1ec7u v\u00e0 gi\u1ea3m thi\u1ec3u r\u1ee7i ro v\u1ec1 b\u1ea3o m\u1eadt. T\u00ednh n\u0103ng b\u1ea3o m\u1eadt AppArmor v\u00e0 c\u00e1c c\u01a1 ch\u1ebf t\u1ef1 \u0111\u1ed9ng h\u00f3a gi\u00fap duy tr\u00ec an ninh cho h\u1ec7 th\u1ed1ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>D\u1ec5 s\u1eed d\u1ee5ng v\u00e0 qu\u1ea3n l\u00fd<\/b><span style=\"font-weight: 400;\">: Ubuntu \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf v\u1edbi giao di\u1ec7n th\u00e2n thi\u1ec7n v\u00e0 quy tr\u00ecnh c\u00e0i \u0111\u1eb7t, qu\u1ea3n l\u00fd ph\u1ea7n m\u1ec1m \u0111\u01a1n gi\u1ea3n, ph\u00f9 h\u1ee3p cho c\u1ea3 ng\u01b0\u1eddi m\u1edbi l\u00e0m quen v\u1edbi Linux.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u00edch h\u1ee3p t\u1ed1t v\u1edbi MySQL<\/b><span style=\"font-weight: 400;\">: Ubuntu l\u00e0 m\u1ed9t n\u1ec1n t\u1ea3ng ph\u1ed5 bi\u1ebfn \u0111\u1ec3 ch\u1ea1y MySQL nh\u1edd v\u00e0o s\u1ef1 \u1ed5n \u0111\u1ecbnh, h\u1ed7 tr\u1ee3 c\u1ed9ng \u0111\u1ed3ng m\u1ea1nh m\u1ebd v\u00e0 c\u00e1c c\u00f4ng c\u1ee5 qu\u1ea3n l\u00fd d\u1ec5 s\u1eed d\u1ee5ng.<\/span><\/li>\n<\/ul>\n<blockquote><p><em>\u0110\u1ecdc th\u00eam: <a href=\"https:\/\/itviec.com\/blog\/ubuntu-la-gi\/\" target=\"_blank\" rel=\"noopener\"><strong>Ubuntu l\u00e0 g\u00ec: \u0110\u1ecbnh ngh\u0129a, \u01afu \u0111i\u1ec3m v\u00e0 H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t<\/strong><\/a><\/em><\/p><\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"Dieu_kien_de_cai_dat_MySQL_tren_Ubuntu\"><\/span><b>\u0110i\u1ec1u ki\u1ec7n \u0111\u1ec3 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ec7 \u0111i\u1ec1u h\u00e0nh Ubuntu<\/b><span style=\"font-weight: 400;\">: B\u1ea1n c\u1ea7n c\u00f3 Ubuntu c\u00e0i \u0111\u1eb7t s\u1eb5n tr\u00ean m\u00e1y t\u00ednh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng v\u1edbi quy\u1ec1n sudo<\/b><span style=\"font-weight: 400;\">: T\u00e0i kho\u1ea3n n\u00e0y cho ph\u00e9p b\u1ea1n th\u1ef1c hi\u1ec7n c\u00e1c l\u1ec7nh qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>K\u1ebft n\u1ed1i m\u1ea1ng \u1ed5n \u0111\u1ecbnh<\/b><span style=\"font-weight: 400;\">: \u0110\u1ea3m b\u1ea3o m\u00e1y t\u00ednh c\u1ee7a b\u1ea1n c\u00f3 k\u1ebft n\u1ed1i m\u1ea1ng \u1ed5n \u0111\u1ecbnh \u0111\u1ec3 t\u1ea3i xu\u1ed1ng v\u00e0 c\u00e0i \u0111\u1eb7t c\u00e1c g\u00f3i ph\u1ea7n m\u1ec1m.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Quy\u1ec1n truy c\u1eadp v\u00e0o terminal<\/b><span style=\"font-weight: 400;\">: B\u1ea1n c\u1ea7n c\u00f3 quy\u1ec1n truy c\u1eadp v\u00e0o terminal (giao di\u1ec7n d\u00f2ng l\u1ec7nh) \u0111\u1ec3 th\u1ef1c hi\u1ec7n c\u00e1c l\u1ec7nh c\u00e0i \u0111\u1eb7t MySQL.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Cach_cai_dat_MySQL_tren_Ubuntu_su_dung_goi_apt_tu_terminal\"><\/span><b>C\u00e1ch c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu s\u1eed d\u1ee5ng g\u00f3i apt t\u1eeb terminal<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>B\u01b0\u1edbc 1: C\u1eadp nh\u1eadt package<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Tr\u01b0\u1edbc khi c\u00e0i \u0111\u1eb7t, h\u00e3y c\u1eadp nh\u1eadt danh s\u00e1ch g\u00f3i ph\u1ea7n m\u1ec1m \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o b\u1ea1n c\u00f3 phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t c\u1ee7a c\u00e1c g\u00f3i. M\u1edf Terminal v\u00e0 ch\u1ea1y l\u1ec7nh:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt update<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79204\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-2-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"214\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-2-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-2-vippro-300x80.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-2-vippro-700x187.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-2-vippro-200x54.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-2-vippro-100x27.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h3><b>B\u01b0\u1edbc 2: C\u00e0i \u0111\u1eb7t MySQL<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi \u0111\u00e3 c\u1eadp nh\u1ea5t package, ta s\u1eed d\u1ee5ng l\u1ec7nh sau \u0111\u1ec3 c\u00e0i \u0111\u1eb7t MySQL Server:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt install mysql-server<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79203\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-3-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"218\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-3-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-3-vippro-300x82.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-3-vippro-700x191.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-3-vippro-200x55.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-3-vippro-100x27.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">C\u00f2n \u0111\u1ec3 c\u00e0i \u0111\u1eb7t m\u1ed9t phi\u00ean b\u1ea3n MySQL c\u1ee5 th\u1ec3 tr\u00ean Ubuntu, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ec9 \u0111\u1ecbnh phi\u00ean b\u1ea3n MySQL mong mu\u1ed1n trong l\u1ec7nh c\u00e0i \u0111\u1eb7t v\u1edbi c\u00fa ph\u00e1p nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt install mysql-server-[version]<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 \u0111\u1ec3 c\u00e0i \u0111\u1eb7t phi\u00ean b\u1ea3n MySQL 8.0 ta c\u00f3 c\u00fa ph\u00e1p nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt install mysql-server-8.0<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y s\u1ebd c\u00e0i \u0111\u1eb7t phi\u00ean b\u1ea3n MySQL 8.0 thay v\u00ec phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t theo m\u1eb7c \u0111\u1ecbnh.<\/span><\/p>\n<h3><b>B\u01b0\u1edbc 3: C\u1ea5u h\u00ecnh b\u1ea3o m\u1eadt cho MySQL<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi c\u00e0i \u0111\u1eb7t MySQL, b\u01b0\u1edbc ti\u1ebfp theo l\u00e0 th\u1ef1c hi\u1ec7n thi\u1ebft l\u1eadp b\u1ea3o m\u1eadt ban \u0111\u1ea7u cho c\u00e0i \u0111\u1eb7t MySQL c\u1ee7a b\u1ea1n. Quy tr\u00ecnh b\u1ea3o m\u1eadt bao g\u1ed3m:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Thi\u1ebft l\u1eadp l\u1ea1i m\u1eadt kh\u1ea9u<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">X\u00f3a t\u00e0i kho\u1ea3n anonymous v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u ki\u1ec3m th\u1eed kh\u00f4ng c\u1ea7n thi\u1ebft<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">H\u1ea1n ch\u1ebf quy\u1ec1n truy c\u1eadp \u0111\u1ec3 t\u0103ng c\u01b0\u1eddng b\u1ea3o m\u1eadt t\u1ed5ng th\u1ec3.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo mysql_secure_installation<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79202\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-4-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"54\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-4-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-4-vippro-300x20.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-4-vippro-700x47.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-4-vippro-200x14.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-4-vippro-100x7.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y s\u1ebd k\u1ebft n\u1ed1i \u0111\u1ebfn m\u00e1y ch\u1ee7 MySQL. N\u1ebfu t\u00e0i kho\u1ea3n root ch\u01b0a \u0111\u01b0\u1ee3c thi\u1ebft l\u1eadp m\u1eadt kh\u1ea9u, l\u1ec7nh c\u00f3 th\u1ec3 k\u1ebft n\u1ed1i m\u00e0 kh\u00f4ng y\u00eau c\u1ea7u m\u1eadt kh\u1ea9u. T\u00f9y thu\u1ed9c v\u00e0o c\u1ea5u h\u00ecnh h\u1ec7 th\u1ed1ng, ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c y\u00eau c\u1ea7u cung c\u1ea5p m\u1eadt kh\u1ea9u c\u1ee7a t\u00e0i kho\u1ea3n root trong b\u01b0\u1edbc n\u00e0y.<\/span><\/p>\n<h4><b>3.1 X\u1eed l\u00fd l\u1ed7i khi ch\u1ea1y <\/b><b>mysql_secure_installation<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Trong m\u1ed9t s\u1ed1 tr\u01b0\u1eddng h\u1ee3p, khi ch\u1ea1y l\u1ec7nh <\/span><span style=\"font-weight: 400;\">mysql_secure_installation<\/span><span style=\"font-weight: 400;\">, c\u00f3 th\u1ec3 x\u1ea3y ra l\u1ed7i do t\u00e0i kho\u1ea3n <\/span><span style=\"font-weight: 400;\">root<\/span><span style=\"font-weight: 400;\"> tr\u00ean Ubuntu kh\u00f4ng \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u1ec3 k\u1ebft n\u1ed1i b\u1eb1ng m\u1eadt kh\u1ea9u. C\u1ee5 th\u1ec3, t\u1eeb th\u00e1ng 7\/2022, n\u1ebfu t\u00e0i kho\u1ea3n <\/span><span style=\"font-weight: 400;\">root<\/span><span style=\"font-weight: 400;\"> \u0111ang s\u1eed d\u1ee5ng ph\u01b0\u01a1ng th\u1ee9c x\u00e1c th\u1ef1c <\/span><span style=\"font-weight: 400;\">auth_socket<\/span><span style=\"font-weight: 400;\">, script s\u1ebd g\u1eb7p l\u1ed7i khi c\u1ed1 g\u1eafng \u0111\u1eb7t m\u1eadt kh\u1ea9u cho t\u00e0i kho\u1ea3n n\u00e0y.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">L\u1ed7i c\u00f3 th\u1ec3 xu\u1ea5t hi\u1ec7n nh\u01b0 sau:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">Output<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">&#8230; Failed! Error: SET PASSWORD has no significance for user &#8216;root&#8217;@&#8217;localhost&#8217; as the authentication method used doesn&#8217;t store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">New password:<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 kh\u1eafc ph\u1ee5c l\u1ed7i n\u00e0y, b\u1ea1n c\u00f3 th\u1ec3 l\u00e0m theo c\u00e1c b\u01b0\u1edbc sau:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>B\u01b0\u1edbc 1:<\/strong> Chuy\u1ec3n sang ph\u01b0\u01a1ng th\u1ee9c x\u00e1c th\u1ef1c s\u1eed d\u1ee5ng m\u1eadt kh\u1ea9u b\u1eb1ng c\u00e1ch m\u1edf MySQL prompt v\u1edbi l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo mysql<\/span><\/pre>\n<p><span style=\"font-weight: 400;\"><strong>B\u01b0\u1edbc 2:<\/strong> Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 thay \u0111\u1ed5i ph\u01b0\u01a1ng th\u1ee9c x\u00e1c th\u1ef1c cho t\u00e0i kho\u1ea3n <\/span><span style=\"font-weight: 400;\">root<\/span><span style=\"font-weight: 400;\"> sang s\u1eed d\u1ee5ng m\u1eadt kh\u1ea9u:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Thay <\/span><span style=\"font-weight: 400;\">password<\/span><span style=\"font-weight: 400;\"> b\u1eb1ng m\u1eadt kh\u1ea9u b\u1ea1n mu\u1ed1n \u0111\u1eb7t cho t\u00e0i kho\u1ea3n <\/span><span style=\"font-weight: 400;\">root<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>B\u01b0\u1edbc 3:<\/strong> Tho\u00e1t kh\u1ecfi MySQL prompt:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">exit<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Sau \u0111\u00f3, b\u1ea1n c\u00f3 th\u1ec3 ti\u1ebfp t\u1ee5c ch\u1ea1y l\u1ec7nh <\/span><span style=\"font-weight: 400;\">mysql_secure_installation<\/span><span style=\"font-weight: 400;\"> m\u00e0 kh\u00f4ng g\u1eb7p ph\u1ea3i l\u1ed7i tr\u00ean.<\/span><\/p>\n<h4><b>3.2 Thi\u1ebft l\u1eadp m\u1eadt kh\u1ea9u<\/b><\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79211\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-5-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"122\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-5-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-5-vippro-300x46.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-5-vippro-700x107.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-5-vippro-200x31.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-5-vippro-100x15.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ea7u ti\u00ean, h\u1ec7 th\u1ed1ng s\u1ebd y\u00eau c\u1ea7u thi\u1ebft l\u1eadp quy t\u1eafc x\u00e1c th\u1ef1c m\u1eadt kh\u1ea9u. Nh\u1ea5n <\/span><i><span style=\"font-weight: 400;\">Y<\/span><\/i><span style=\"font-weight: 400;\"> \u0111\u1ec3 ti\u1ebfp t\u1ee5c ho\u1eb7c k\u00fd t\u1ef1 b\u1ea5t k\u1ef3 \u0111\u1ec3 b\u1ecf qua b\u01b0\u1edbc n\u00e0y.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79210\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-6-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"173\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-6-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-6-vippro-300x65.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-6-vippro-700x151.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-6-vippro-200x43.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-6-vippro-100x22.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Ng\u01b0\u1eddi d\u00f9ng c\u00f3 ba t\u00f9y ch\u1ecdn cho ch\u00ednh s\u00e1ch m\u1eadt kh\u1ea9u:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">0 &#8211; th\u1ea5p.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">1 &#8211; trung b\u00ecnh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">2 &#8211; m\u1ea1nh.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Ch\u1ecdn m\u1ed9t t\u00f9y ch\u1ecdn v\u00e0 nh\u1ea5n Enter.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">T\u00f9y thu\u1ed9c v\u00e0o h\u1ec7 th\u1ed1ng, b\u01b0\u1edbc ti\u1ebfp theo s\u1ebd y\u00eau c\u1ea7u thi\u1ebft l\u1eadp m\u1eadt kh\u1ea9u ho\u1eb7c b\u1ecb b\u1ecf qua ho\u00e0n to\u00e0n.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tr\u01b0\u1eddng h\u1ee3p \u0111\u01b0\u1ee3c y\u00eau c\u1ea7u thi\u1ebft l\u1eadp l\u1ea1i m\u1eadt kh\u1ea9u:<\/b><span style=\"font-weight: 400;\"> B\u1ea1n s\u1ebd nh\u1eadp m\u1eadt kh\u1ea9u 2 l\u1ea7n \u0111\u1ec3 x\u00e1c nh\u1eadn.<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79209\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-7-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"248\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-7-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-7-vippro-300x93.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-7-vippro-700x217.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-7-vippro-200x62.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-7-vippro-100x31.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tr\u01b0\u1eddng h\u1ee3p ng\u01b0\u1eddi d\u00f9ng root \u0111\u0103ng nh\u1eadp m\u00e0 kh\u00f4ng cung c\u1ea5p m\u1eadt kh\u1ea9u<\/b><span style=\"font-weight: 400;\">: Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, ph\u01b0\u01a1ng th\u1ee9c x\u00e1c th\u1ef1c <\/span><span style=\"font-weight: 400;\">auth_socket<\/span><span style=\"font-weight: 400;\"> \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng theo m\u1eb7c \u0111\u1ecbnh, cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng \u0111\u0103ng nh\u1eadp b\u1eb1ng th\u00f4ng tin x\u00e1c th\u1ef1c c\u1ee7a h\u1ec7 \u0111i\u1ec1u h\u00e0nh.<\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79208\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-8-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"278\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-8-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-8-vippro-300x104.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-8-vippro-700x243.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-8-vippro-200x70.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-8-vippro-100x35.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">B\u1ea1n v\u1eabn c\u00f3 th\u1ec3 thay \u0111\u1ed5i m\u1eadt kh\u1ea9u b\u1eb1ng l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">ALTER USER 'root'@'localhost' IDENTIFIED BY '[password]';<\/span><\/pre>\n<h4><b>3.3 Xo\u00e1 ng\u01b0\u1eddi d\u00f9ng \u1ea9n danh<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Ng\u01b0\u1eddi d\u00f9ng \u1ea9n danh l\u00e0 c\u00e1c t\u00e0i kho\u1ea3n \u0111\u01b0\u1ee3c t\u1ea1o m\u1eb7c \u0111\u1ecbnh m\u00e0 kh\u00f4ng c\u00f3 t\u00ean c\u1ee5 th\u1ec3, cho ph\u00e9p k\u1ebft n\u1ed1i v\u1edbi MySQL m\u00e0 kh\u00f4ng c\u1ea7n th\u00f4ng tin x\u00e1c th\u1ef1c. M\u1eb7c d\u00f9 ban \u0111\u1ea7u \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 th\u1eed nghi\u1ec7m, nh\u01b0ng n\u00ean x\u00f3a ng\u01b0\u1eddi d\u00f9ng n\u00e0y v\u00ec l\u00fd do:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ng\u01b0\u1eddi d\u00f9ng \u1ea9n danh c\u00f3 th\u1ec3 \u0111\u0103ng nh\u1eadp v\u00e0o MySQL m\u00e0 kh\u00f4ng c\u1ea7n t\u00e0i kho\u1ea3n r\u00f5 r\u00e0ng, g\u00e2y r\u1ee7i ro b\u1ea3o m\u1eadt v\u00ec h\u1ecd c\u00f3 th\u1ec3 truy c\u1eadp v\u00e0o c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u1edbi quy\u1ec1n h\u1ea1n h\u1ea1n ch\u1ebf.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Vi\u1ec7c gi\u1eef l\u1ea1i ng\u01b0\u1eddi d\u00f9ng \u1ea9n danh c\u00f3 th\u1ec3 t\u1ea1o c\u01a1 h\u1ed9i cho nh\u1eefng cu\u1ed9c t\u1ea5n c\u00f4ng kh\u00f4ng mong mu\u1ed1n v\u00e0o h\u1ec7 th\u1ed1ng c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">B\u1ea1n c\u00f3 th\u1ec3 xo\u00e1 ng\u01b0\u1eddi d\u00f9ng \u1ea9n danh b\u1eb1ng c\u00e1ch ch\u1ea1y l\u1ec7nh <\/span><span style=\"font-weight: 400;\">sudo mysql_secure_installation<\/span><span style=\"font-weight: 400;\"> v\u00e0 tr\u1ea3 l\u1eddi b\u1eb1ng <\/span><i><span style=\"font-weight: 400;\">Y<\/span><\/i><span style=\"font-weight: 400;\"> \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o thi\u1ebft l\u1eadp MySQL an to\u00e0n h\u01a1n.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79214\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-9-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"163\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-9-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-9-vippro-300x61.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-9-vippro-700x143.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-9-vippro-200x41.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-9-vippro-100x20.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h3><b>B\u01b0\u1edbc 4: Ki\u1ec3m tra tr\u1ea1ng th\u00e1i c\u1ee7a MySQL\u00a0<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi c\u00e0i \u0111\u1eb7t, MySQL s\u1ebd t\u1ef1 \u0111\u1ed9ng kh\u1edfi \u0111\u1ed9ng. \u0110\u1ec3 x\u00e1c minh r\u1eb1ng m\u00e1y ch\u1ee7 \u0111ang ho\u1ea1t \u0111\u1ed9ng ta d\u00f9ng l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo systemctl status mysql<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79212\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-11-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"306\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-11-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-11-vippro-300x115.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-11-vippro-700x268.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-11-vippro-200x77.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-11-vippro-100x38.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h3><b>B\u01b0\u1edbc 5: \u0110\u0103ng nh\u1eadp v\u00e0o MySQL Server<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">B\u01b0\u1edbc cu\u1ed1i c\u00f9ng l\u00e0 \u0111\u0103ng nh\u1eadp v\u00e0o m\u00e1y ch\u1ee7 MySQL, ta d\u00f9ng l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo mysql -u root -p<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u1ec7nh tr\u00ean s\u1ebd cung c\u1ea5p cho ng\u01b0\u1eddi d\u00f9ng root quy\u1ec1n truy c\u1eadp v\u00e0o giao di\u1ec7n MySQL v\u00e0 kh\u1ea3 n\u0103ng t\u01b0\u01a1ng t\u00e1c v\u1edbi m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u MySQL b\u1eb1ng c\u00e1c l\u1ec7nh v\u00e0 truy v\u1ea5n SQL. N\u1ebfu ng\u01b0\u1eddi d\u00f9ng \u0111\u00e3 \u0111\u1eb7t m\u1eadt kh\u1ea9u cho root, l\u1ec7nh s\u1ebd nh\u1eafc nh\u1eadp m\u1eadt kh\u1ea9u c\u1ee7a ng\u01b0\u1eddi d\u00f9ng root. Sau khi cung c\u1ea5p, ng\u01b0\u1eddi d\u00f9ng s\u1ebd c\u00f3 to\u00e0n quy\u1ec1n truy c\u1eadp.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-79215\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-12-vippro.png\" alt=\"mysql ubuntu - itviec blog\" width=\"800\" height=\"259\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-12-vippro.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-12-vippro-300x97.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-12-vippro-700x227.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-12-vippro-200x65.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/mysql-ubuntu-12-vippro-100x32.png 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cai_dat_MySQL_tren_Ubuntu_tu_trang_chu_MySQL\"><\/span><b>C\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu t\u1eeb trang ch\u1ee7 MySQL<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>B\u01b0\u1edbc 1: T\u1ea3i g\u00f3i c\u00e0i \u0111\u1eb7t MySQL t\u1eeb trang ch\u1ee7:<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Truy c\u1eadp trang web ch\u00ednh th\u1ee9c c\u1ee7a MySQL t\u1ea1i <\/span><a href=\"https:\/\/dev.mysql.com\/downloads\/\"><span style=\"font-weight: 400;\">MySQL Downloads<\/span><\/a><span style=\"font-weight: 400;\">. T\u1ea1i \u0111\u00e2y, ch\u1ecdn phi\u00ean b\u1ea3n MySQL mong mu\u1ed1n v\u00e0 h\u1ec7 \u0111i\u1ec1u h\u00e0nh t\u01b0\u01a1ng \u1ee9ng (Ubuntu\/Debian).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">B\u1ea1n s\u1ebd nh\u1eadn \u0111\u01b0\u1ee3c m\u1ed9t t\u1ec7p <\/span><span style=\"font-weight: 400;\">.deb<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 c\u00e0i \u0111\u1eb7t MySQL. Sau khi t\u1ea3i xu\u1ed1ng, m\u1edf Terminal v\u00e0 \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn th\u01b0 m\u1ee5c ch\u1ee9a t\u1ec7p <\/span><span style=\"font-weight: 400;\">.deb<\/span><span style=\"font-weight: 400;\"> c\u1ee7a b\u1ea1n:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">cd \/\u0111\u01b0\u1eddng-d\u1eabn-t\u1edbi-t\u1ec7p<\/span><\/pre>\n<h3><b>B\u01b0\u1edbc 2: C\u00e0i \u0111\u1eb7t g\u00f3i t\u1ea3i v\u1ec1<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi \u0111\u00e3 \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn th\u01b0 m\u1ee5c ch\u1ee9a t\u1ec7p <\/span><span style=\"font-weight: 400;\">.deb<\/span><span style=\"font-weight: 400;\">, s\u1eed d\u1ee5ng l\u1ec7nh <\/span><span style=\"font-weight: 400;\">dpkg<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 c\u00e0i \u0111\u1eb7t g\u00f3i:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo dpkg -i t\u00ean-t\u1ec7p-deb<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u01b0u \u00fd thay <\/span><span style=\"font-weight: 400;\">t\u00ean-t\u1ec7p-deb<\/span><span style=\"font-weight: 400;\"> b\u1eb1ng t\u00ean t\u1ec7p .deb m\u00e0 b\u1ea1n \u0111\u00e3 t\u1ea3i v\u1ec1.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Sau khi ch\u1ea1y l\u1ec7nh n\u00e0y, m\u1ed9t giao di\u1ec7n c\u1ea5u h\u00ecnh s\u1ebd xu\u1ea5t hi\u1ec7n. B\u1ea1n c\u00f3 th\u1ec3 ch\u1ecdn phi\u00ean b\u1ea3n MySQL m\u00e0 b\u1ea1n mu\u1ed1n c\u00e0i \u0111\u1eb7t trong danh s\u00e1ch.<\/span><\/p>\n<h3><b>B\u01b0\u1edbc 3: C\u1eadp nh\u1eadt danh s\u00e1ch g\u00f3i<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi c\u1ea5u h\u00ecnh MySQL APT repository, c\u1eadp nh\u1eadt l\u1ea1i danh s\u00e1ch g\u00f3i v\u1edbi l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt update<\/span><\/pre>\n<h3><b>B\u01b0\u1edbc 4: C\u00e0i \u0111\u1eb7t MySQL Server<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Cu\u1ed1i c\u00f9ng, c\u00e0i \u0111\u1eb7t MySQL b\u1eb1ng l\u1ec7nh:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt install mysql-server<\/span><\/pre>\n<h3><b>B\u01b0\u1edbc 5: C\u1ea5u h\u00ecnh b\u1ea3o m\u1eadt<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sau khi c\u00e0i \u0111\u1eb7t, th\u1ef1c hi\u1ec7n c\u00e1c b\u01b0\u1edbc c\u1ea5u h\u00ecnh b\u1ea3o m\u1eadt nh\u01b0 \u0111\u00e3 h\u01b0\u1edbng d\u1eabn tr\u01b0\u1edbc \u0111\u00f3:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo mysql_secure_installation<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Sau khi ho\u00e0n th\u00e0nh c\u00e1c b\u01b0\u1edbc tr\u00ean, MySQL \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t th\u00e0nh c\u00f4ng tr\u00ean h\u1ec7 th\u1ed1ng Ubuntu c\u1ee7a b\u1ea1n v\u00e0 s\u1eb5n s\u00e0ng s\u1eed d\u1ee5ng.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Mot_so_thao_tac_khac_trong_MySQL\"><\/span><b>M\u1ed9t s\u1ed1 thao t\u00e1c kh\u00e1c trong MySQL<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Cho ph\u00e9p truy c\u1eadp t\u1eeb xa<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">N\u1ebfu b\u1ea1n mu\u1ed1n k\u1ebft n\u1ed1i v\u1edbi MySQL t\u1eeb m\u1ed9t m\u00e1y kh\u00e1c (kh\u00f4ng c\u00f9ng server), b\u1ea1n c\u1ea7n m\u1edf c\u1ed5ng firewall (m\u1eb7c \u0111\u1ecbnh l\u00e0 c\u1ed5ng 3306). Ch\u1ea1y c\u00e1c l\u1ec7nh sau \u0111\u1ec3 b\u1eadt firewall v\u00e0 cho ph\u00e9p truy c\u1eadp MySQL t\u1eeb xa:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo ufw enable<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sudo ufw allow mysql<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Sau khi m\u1edf c\u1ed5ng firewall, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00fa ph\u00e1p sau \u0111\u1ec3 k\u1ebft n\u1ed1i t\u1eeb xa v\u1edbi MySQL:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">mysql -h mysql_server_ip -P mysql_port -u username -p<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Trong \u0111\u00f3:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>mysql_server_ip<\/b><span style=\"font-weight: 400;\">: \u0110\u1ecba ch\u1ec9 IP c\u1ee7a server MySQL.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>mysql_port<\/b><span style=\"font-weight: 400;\">: C\u1ed5ng MySQL (m\u1eb7c \u0111\u1ecbnh l\u00e0 3306, tr\u1eeb khi b\u1ea1n \u0111\u00e3 thay \u0111\u1ed5i).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>username<\/b><span style=\"font-weight: 400;\">: T\u00ean ng\u01b0\u1eddi d\u00f9ng MySQL.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5, n\u1ebfu b\u1ea1n mu\u1ed1n k\u1ebft n\u1ed1i t\u1edbi server MySQL c\u00f3 \u0111\u1ecba ch\u1ec9 IP l\u00e0 <\/span><span style=\"font-weight: 400;\">192.168.1.100<\/span><span style=\"font-weight: 400;\"> qua c\u1ed5ng m\u1eb7c \u0111\u1ecbnh 3306 v\u1edbi t\u00e0i kho\u1ea3n <\/span><span style=\"font-weight: 400;\">root<\/span><span style=\"font-weight: 400;\">, c\u00fa ph\u00e1p s\u1ebd nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">mysql -h 192.168.1.100 -P 3306 -u root -p<\/span><\/pre>\n<h3><b>Xem danh s\u00e1ch ng\u01b0\u1eddi d\u00f9ng<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 xem danh s\u00e1ch c\u00e1c ng\u01b0\u1eddi d\u00f9ng \u0111\u00e3 \u0111\u01b0\u1ee3c thi\u1ebft l\u1eadp tr\u00ean MySQL, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">SELECT User, Host, authentication_string FROM mysql.user;<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y s\u1ebd hi\u1ec3n th\u1ecb t\u00ean ng\u01b0\u1eddi d\u00f9ng, host li\u00ean k\u1ebft v\u00e0 chu\u1ed7i m\u1eadt kh\u1ea9u \u0111\u00e3 m\u00e3 h\u00f3a.<\/span><\/p>\n<h3><b>T\u1ea1o v\u00e0 qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/b><\/h3>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u0110\u1ec3 t\u1ea1o m\u1ed9t c\u01a1 s\u1edf d\u1eef li\u1ec7u m\u1edbi, s\u1eed d\u1ee5ng l\u1ec7nh:<\/span><\/li>\n<\/ul>\n<pre><span style=\"font-weight: 400;\">CREATE DATABASE ten_database;<\/span><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Sau khi t\u1ea1o, b\u1ea1n c\u00f3 th\u1ec3 xem danh s\u00e1ch c\u00e1c c\u01a1 s\u1edf d\u1eef li\u1ec7u b\u1eb1ng l\u1ec7nh:<\/span><\/li>\n<\/ul>\n<pre><span style=\"font-weight: 400;\">SHOW DATABASES;<\/span><\/pre>\n<h3><b>T\u1ea1o ng\u01b0\u1eddi d\u00f9ng m\u1edbi v\u00e0 g\u00e1n quy\u1ec1n truy c\u1eadp<\/b><\/h3>\n<h4><b>C\u00e1ch 1: S\u1eed d\u1ee5ng c\u00fa ph\u00e1p <\/b><b>CREATE USER<\/b><\/h4>\n<p><b>T\u1ea1o ng\u01b0\u1eddi d\u00f9ng m\u1edbi<\/b><span style=\"font-weight: 400;\">: B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh <\/span><span style=\"font-weight: 400;\">CREATE USER<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 t\u1ea1o ng\u01b0\u1eddi d\u00f9ng m\u1edbi. V\u00ed d\u1ee5, t\u1ea1o ng\u01b0\u1eddi d\u00f9ng <\/span><span style=\"font-weight: 400;\">sammy<\/span><span style=\"font-weight: 400;\"> v\u1edbi quy\u1ec1n truy c\u1eadp c\u1ee5c b\u1ed9 v\u00e0 m\u1eadt kh\u1ea9u &#8216;password&#8217;:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">N\u1ebfu b\u1ea1n mu\u1ed1n ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 k\u1ebft n\u1ed1i t\u1eeb xa, thay th\u1ebf <\/span><span style=\"font-weight: 400;\">localhost<\/span><span style=\"font-weight: 400;\"> b\u1eb1ng \u0111\u1ecba ch\u1ec9 IP c\u1ee7a m\u00e1y ch\u1ee7 ho\u1eb7c s\u1eed d\u1ee5ng k\u00fd t\u1ef1 <\/span><span style=\"font-weight: 400;\">%<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 cho ph\u00e9p truy c\u1eadp t\u1eeb b\u1ea5t k\u1ef3 \u0111\u1ecba ch\u1ec9 IP n\u00e0o.<\/span><\/p>\n<p><b>G\u00e1n quy\u1ec1n truy c\u1eadp<\/b><span style=\"font-weight: 400;\">: Sau khi t\u1ea1o ng\u01b0\u1eddi d\u00f9ng, b\u1ea1n c\u00f3 th\u1ec3 c\u1ea5p quy\u1ec1n truy c\u1eadp cho h\u1ecd v\u1edbi l\u1ec7nh <\/span><span style=\"font-weight: 400;\">GRANT<\/span><span style=\"font-weight: 400;\">. V\u00ed d\u1ee5, g\u00e1n to\u00e0n b\u1ed9 quy\u1ec1n truy c\u1eadp cho c\u01a1 s\u1edf d\u1eef li\u1ec7u <\/span><span style=\"font-weight: 400;\">demodb<\/span><span style=\"font-weight: 400;\">:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">GRANT ALL PRIVILEGES ON demodb.* TO 'sammy'@'localhost';<\/span><\/pre>\n<p><b>L\u00e0m m\u1edbi quy\u1ec1n<\/b><span style=\"font-weight: 400;\">: Sau khi th\u1ef1c hi\u1ec7n thay \u0111\u1ed5i, d\u00f9ng l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">FLUSH PRIVILEGES;<\/span><\/pre>\n<h4><b>C\u00e1ch 2: Ch\u00e8n tr\u1ef1c ti\u1ebfp v\u00e0o <\/b><b>mysql.user<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Thay v\u00ec s\u1eed d\u1ee5ng t\u00e0i kho\u1ea3n root v\u1edbi quy\u1ec1n truy c\u1eadp cao, b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o ng\u01b0\u1eddi d\u00f9ng m\u1edbi v\u1edbi quy\u1ec1n gi\u1edbi h\u1ea1n. V\u00ed d\u1ee5, t\u1ea1o ng\u01b0\u1eddi d\u00f9ng <\/span><i><span style=\"font-weight: 400;\">demouser<\/span><\/i><span style=\"font-weight: 400;\"> v\u00e0 g\u00e1n quy\u1ec1n \u0111\u1ea7y \u0111\u1ee7 cho c\u01a1 s\u1edf d\u1eef li\u1ec7u <\/span><i><span style=\"font-weight: 400;\">demodb<\/span><\/i><span style=\"font-weight: 400;\"> v\u1edbi l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">-- Ch\u00e8n m\u1ed9t ng\u01b0\u1eddi d\u00f9ng m\u1edbi v\u00e0o b\u1ea3ng mysql.user<\/span>\r\n\r\n<span style=\"font-weight: 400;\">-- C\u00e1c tr\u01b0\u1eddng ssl_cipher, x509_issuer v\u00e0 x509_subject \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng v\u00ec kh\u00f4ng y\u00eau c\u1ea7u SSL cho ng\u01b0\u1eddi d\u00f9ng n\u00e0y<\/span>\r\n\r\n<span style=\"font-weight: 400;\">INSERT INTO<\/span><span style=\"font-weight: 400;\"> mysql.<\/span><span style=\"font-weight: 400;\">user<\/span><span style=\"font-weight: 400;\"> (User,Host,authentication_string,ssl_cipher,x509_issuer,x509_subject)<\/span>\r\n\r\n<span style=\"font-weight: 400;\">VALUES<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'demouser'<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">'localhost'<\/span><span style=\"font-weight: 400;\">,PASSWORD(<\/span><span style=\"font-weight: 400;\">'matkhau_demo'<\/span><span style=\"font-weight: 400;\">),<\/span><span style=\"font-weight: 400;\">''<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">''<\/span><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">''<\/span><span style=\"font-weight: 400;\">);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">-- L\u00e0m m\u1edbi l\u1ea1i quy\u1ec1n \u0111\u1ec3 \u00e1p d\u1ee5ng thay \u0111\u1ed5i<\/span>\r\n\r\n<span style=\"font-weight: 400;\">FLUSH PRIVILEGES;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">-- G\u00e1n t\u1ea5t c\u1ea3 c\u00e1c quy\u1ec1n cho t\u1ea5t c\u1ea3 c\u00e1c b\u1ea3ng trong c\u01a1 s\u1edf d\u1eef li\u1ec7u 'demodb'<\/span>\r\n\r\n<span style=\"font-weight: 400;\">GRANT<\/span><span style=\"font-weight: 400;\"> ALLPRIVILEGES <\/span><span style=\"font-weight: 400;\">ON<\/span><span style=\"font-weight: 400;\"> demodb.* <\/span><span style=\"font-weight: 400;\">TO<\/span> <span style=\"font-weight: 400;\">'demouser'<\/span><span style=\"font-weight: 400;\">@'<\/span><span style=\"font-weight: 400;\">localhost'<\/span><span style=\"font-weight: 400;\">;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">-- L\u00e0m m\u1edbi l\u1ea1i quy\u1ec1n m\u1ed9t l\u1ea7n n\u1eefa \u0111\u1ec3 \u00e1p d\u1ee5ng thay \u0111\u1ed5i m\u1edbi nh\u1ea5t<\/span>\r\n\r\n<span style=\"font-weight: 400;\">FLUSH PRIVILEGES;<\/span><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Cau_hinh_Nang_cao_MySQL_Toi_uu_hoa_Hieu_suat_May_chu\"><\/span><b>C\u1ea5u h\u00ecnh N\u00e2ng cao MySQL: T\u1ed1i \u01b0u h\u00f3a Hi\u1ec7u su\u1ea5t M\u00e1y ch\u1ee7<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Vi\u1ec7c c\u1ea5u h\u00ecnh n\u00e2ng cao MySQL gi\u00fap t\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t m\u00e1y ch\u1ee7, \u0111\u1eb7c bi\u1ec7t quan tr\u1ecdng khi b\u1ea1n c\u1ea7n MySQL ho\u1ea1t \u0111\u1ed9ng nhanh h\u01a1n v\u00e0 \u1ed5n \u0111\u1ecbnh h\u01a1n. C\u1ea5u h\u00ecnh n\u00e2ng cao bao g\u1ed3m vi\u1ec7c \u0111i\u1ec1u ch\u1ec9nh c\u00e1c tham s\u1ed1 trong t\u1ec7p c\u1ea5u h\u00ecnh c\u1ee7a MySQL \u0111\u1ec3 m\u00e1y ch\u1ee7 c\u00f3 th\u1ec3 x\u1eed l\u00fd kh\u1ed1i l\u01b0\u1ee3ng c\u00f4ng vi\u1ec7c l\u1edbn h\u01a1n, \u0111\u00e1p \u1ee9ng t\u1ed1t h\u01a1n nhu c\u1ea7u s\u1eed d\u1ee5ng.<\/span><\/p>\n<h3><b>Quy tr\u00ecnh th\u1ef1c hi\u1ec7n c\u1ea5u h\u00ecnh n\u00e2ng cao<\/b><\/h3>\n<p><b>B\u01b0\u1edbc 1: Sao l\u01b0u d\u1eef li\u1ec7u hi\u1ec7n c\u00f3<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Tr\u01b0\u1edbc khi thay \u0111\u1ed5i c\u1ea5u h\u00ecnh, h\u00e3y sao l\u01b0u to\u00e0n b\u1ed9 d\u1eef li\u1ec7u c\u1ee7a MySQL \u0111\u1ec3 tr\u00e1nh m\u1ea5t m\u00e1t th\u00f4ng tin v\u1edbi l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">mysqldump --all-databases --routines -u root -p &gt; ~\/fulldump.sql<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">L\u1ec7nh n\u00e0y s\u1ebd t\u1ea1o b\u1ea3n sao to\u00e0n b\u1ed9 d\u1eef li\u1ec7u. Tuy nhi\u00ean ph\u1ea3i l\u01b0u \u00fd \u0111\u1ea3m b\u1ea3o kh\u00f4ng c\u00f3 ng\u01b0\u1eddi d\u00f9ng n\u00e0o truy c\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u trong l\u00fac sao l\u01b0u.<\/span><\/p>\n<p><b>B\u01b0\u1edbc 2: D\u1eebng MySQL v\u00e0 sao l\u01b0u c\u1ea5u h\u00ecnh hi\u1ec7n t\u1ea1i<\/b><\/p>\n<p><span style=\"font-weight: 400;\">T\u1eaft MySQL \u0111\u1ec3 ng\u0103n kh\u00f4ng cho b\u1ea5t k\u1ef3 thay \u0111\u1ed5i n\u00e0o x\u1ea3y ra trong qu\u00e1 tr\u00ecnh c\u1ea5u h\u00ecnh v\u1edbi l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo service mysql stop<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Sau \u0111\u00f3, sao l\u01b0u c\u00e1c t\u1ec7p c\u1ea5u h\u00ecnh g\u1ed1c c\u1ee7a MySQL \u0111\u1ec3 c\u00f3 th\u1ec3 kh\u00f4i ph\u1ee5c n\u1ebfu c\u1ea7n v\u1edbi l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo rsync -avz \/etc\/mysql \/root\/mysql-backup<\/span><\/pre>\n<p><b>B\u01b0\u1edbc 3: Th\u1ef1c hi\u1ec7n thay \u0111\u1ed5i c\u1ea5u h\u00ecnh<\/b><\/p>\n<p><span style=\"font-weight: 400;\">M\u1edf v\u00e0 ch\u1ec9nh s\u1eeda t\u1ec7p c\u1ea5u h\u00ecnh MySQL (<\/span><span style=\"font-weight: 400;\">\/etc\/mysql\/my.cnf<\/span><span style=\"font-weight: 400;\"> ho\u1eb7c <\/span><span style=\"font-weight: 400;\">my.ini<\/span><span style=\"font-weight: 400;\">), thay \u0111\u1ed5i c\u00e1c tham s\u1ed1 \u0111\u1ec3 ph\u00f9 h\u1ee3p v\u1edbi nhu c\u1ea7u c\u1ee7a b\u1ea1n.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">B\u1ea1n c\u00f3 th\u1ec3 t\u00ecm hi\u1ec3u th\u00eam v\u1ec1 c\u00e1c c\u1ea5u h\u00ecnh c\u1ee7a MySQL<\/span> <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/server-system-variables.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">t\u1ea1i \u0111\u00e2y<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><b>B\u01b0\u1edbc 4: X\u00f3a v\u00e0 kh\u1edfi t\u1ea1o l\u1ea1i kh\u00f4ng gian c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Sau khi thay \u0111\u1ed5i c\u1ea5u h\u00ecnh, b\u1ea1n c\u1ea7n x\u00f3a v\u00e0 kh\u1edfi t\u1ea1o l\u1ea1i c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o c\u1ea5u h\u00ecnh m\u1edbi \u0111\u01b0\u1ee3c \u00e1p d\u1ee5ng v\u1edbi l\u1ec7nh sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo rm -rf \/var\/lib\/mysql\/*<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sudo mysqld --initialize<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sudo chown -R mysql: \/var\/lib\/mysql<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sudo service mysql start<\/span><\/pre>\n<p><b>B\u01b0\u1edbc 5: Nh\u1eadp l\u1ea1i d\u1eef li\u1ec7u \u0111\u00e3 sao l\u01b0u<\/b><\/p>\n<p><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng t\u1ec7p sao l\u01b0u t\u1eeb b\u01b0\u1edbc \u0111\u1ea7u \u0111\u1ec3 kh\u00f4i ph\u1ee5c l\u1ea1i to\u00e0n b\u1ed9 d\u1eef li\u1ec7u b\u1eb1ng l\u1ec7nh:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">cat ~\/fulldump.sql | mysql<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">V\u1edbi d\u1eef li\u1ec7u l\u1edbn, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng <\/span><span style=\"font-weight: 400;\">Pipe Viewer<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 theo d\u00f5i ti\u1ebfn tr\u00ecnh nh\u1eadp nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt install pv<\/span>\r\n\r\n<span style=\"font-weight: 400;\">pv ~\/fulldump.sql | mysql<\/span><\/pre>\n<p><b>L\u01b0u \u00fd<\/b><span style=\"font-weight: 400;\">: Kh\u00f4ng ph\u1ea3i t\u1ea5t c\u1ea3 c\u00e1c thay \u0111\u1ed5i trong c\u1ea5u h\u00ecnh \u0111\u1ec1u y\u00eau c\u1ea7u kh\u1edfi \u0111\u1ed9ng l\u1ea1i MySQL. M\u1ed9t s\u1ed1 thay \u0111\u1ed5i c\u00f3 th\u1ec3 \u00e1p d\u1ee5ng ngay trong khi m\u00e1y ch\u1ee7 \u0111ang ch\u1ea1y. Lu\u00f4n sao l\u01b0u t\u1ec7p c\u1ea5u h\u00ecnh v\u00e0 d\u1eef li\u1ec7u tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n b\u1ea5t k\u1ef3 \u0111i\u1ec1u ch\u1ec9nh n\u00e0o.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cau_hoi_thuong_gap_ve_Cai_dat_MySQL_tren_Ubuntu\"><\/span><b>C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 C\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 g\u1ee1 c\u00e0i \u0111\u1eb7t MySQL kh\u1ecfi Ubuntu?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 g\u1ee1 c\u00e0i \u0111\u1eb7t MySQL ho\u00e0n to\u00e0n kh\u1ecfi Ubuntu, b\u1ea1n c\u00f3 th\u1ec3 l\u00e0m theo c\u00e1c b\u01b0\u1edbc sau:<\/span><\/p>\n<p><b>B\u01b0\u1edbc 1: D\u1eebng d\u1ecbch v\u1ee5 MySQL<\/b><span style=\"font-weight: 400;\">: Tr\u01b0\u1edbc khi g\u1ee1 c\u00e0i \u0111\u1eb7t, h\u00e3y d\u1eebng d\u1ecbch v\u1ee5 MySQL \u0111\u1ec3 tr\u00e1nh c\u00e1c xung \u0111\u1ed9t c\u00f3 th\u1ec3 x\u1ea3y ra b\u1eb1ng l\u1ec7nh:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo systemctl stop mysql<\/span><\/pre>\n<p><b>B\u01b0\u1edbc 2: G\u1ee1 c\u00e0i \u0111\u1eb7t MySQL v\u00e0 c\u00e1c g\u00f3i li\u00ean quan<\/b><span style=\"font-weight: 400;\">: S\u1eed d\u1ee5ng l\u1ec7nh <\/span><span style=\"font-weight: 400;\">apt purge<\/span><span style=\"font-weight: 400;\"> \u0111\u1ec3 g\u1ee1 c\u00e0i \u0111\u1eb7t MySQL, c\u00e1c g\u00f3i li\u00ean quan nh\u01b0 client, file chung\u2026 ta s\u1eed d\u1ee5ng c\u00fa ph\u00e1p sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*<\/span><\/pre>\n<p><b>B\u01b0\u1edbc 3: X\u00f3a file c\u1ea5u h\u00ecnh v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u (T\u00f9y ch\u1ecdn)<\/b><span style=\"font-weight: 400;\">: N\u1ebfu mu\u1ed1n x\u00f3a ho\u00e0n to\u00e0n m\u1ecdi d\u1ea5u v\u1ebft c\u1ee7a MySQL, bao g\u1ed3m file c\u1ea5u h\u00ecnh v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u, b\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng l\u1ec7nh:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo rm -rf \/etc\/mysql \/var\/lib\/mysql<\/span><\/pre>\n<p><b>L\u01b0u \u00fd:<\/b><span style=\"font-weight: 400;\"> L\u1ec7nh n\u00e0y s\u1ebd x\u00f3a v\u0129nh vi\u1ec5n m\u1ecdi file c\u1ea5u h\u00ecnh v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u MySQL. H\u00e3y ch\u1eafc ch\u1eafn sao l\u01b0u d\u1eef li\u1ec7u quan tr\u1ecdng tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n.<\/span><\/p>\n<p><b>B\u01b0\u1edbc 4: X\u00f3a c\u00e1c g\u00f3i MySQL c\u00f2n l\u1ea1i (t\u00f9y ch\u1ecdn)<\/b><span style=\"font-weight: 400;\">: \u0110\u1ec3 d\u1ecdn d\u1eb9p c\u00e1c g\u00f3i ph\u1ee5 thu\u1ed9c MySQL kh\u00f4ng c\u00f2n c\u1ea7n thi\u1ebft ta s\u1eed d\u1ee5ng l\u1ec7nh:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">sudo apt autoremove<\/span><\/pre>\n<h3><b>C\u00f3 c\u1ea7n quy\u1ec1n sudo khi g\u1ee1 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">C\u00f3, b\u1ea1n c\u1ea7n quy\u1ec1n sudo \u0111\u1ec3 th\u1ef1c hi\u1ec7n c\u00e1c l\u1ec7nh g\u1ee1 c\u00e0i \u0111\u1eb7t v\u00e0 x\u00f3a c\u00e1c file c\u1ea5u h\u00ecnh v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u1ee7a MySQL v\u00ec ch\u00fang y\u00eau c\u1ea7u quy\u1ec1n qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng.<\/span><\/p>\n<h3><b>MySQL c\u00f3 h\u1ed7 tr\u1ee3 kh\u00f4i ph\u1ee5c sau khi thay \u0111\u1ed5i c\u1ea5u h\u00ecnh kh\u00f4ng?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">C\u00f3, v\u00e0 b\u1ea1n n\u00ean sao l\u01b0u c\u1ea5u h\u00ecnh v\u00e0 d\u1eef li\u1ec7u tr\u01b0\u1edbc khi thay \u0111\u1ed5i. N\u1ebfu c\u00f3 s\u1ef1 c\u1ed1, b\u1ea1n c\u00f3 th\u1ec3 kh\u00f4i ph\u1ee5c l\u1ea1i b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c b\u1ea3n sao l\u01b0u \u0111\u00e3 t\u1ea1o.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket_Cai_dat_MySQL_tren_Ubuntu\"><\/span><b>T\u1ed5ng k\u1ebft C\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">C\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu l\u00e0 b\u01b0\u1edbc \u0111\u1ea7u quan tr\u1ecdng \u0111\u1ec3 thi\u1ebft l\u1eadp h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u. Vi\u1ec7c s\u1eed d\u1ee5ng MySQL tr\u00ean Ubuntu kh\u00f4ng ch\u1ec9 gi\u00fap b\u1ea1n qu\u1ea3n l\u00fd d\u1eef li\u1ec7u m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3, m\u00e0 c\u00f2n cung c\u1ea5p n\u1ec1n t\u1ea3ng v\u1eefng ch\u1eafc cho c\u00e1c \u1ee9ng d\u1ee5ng v\u00e0 d\u1ecbch v\u1ee5 c\u1ee7a b\u1ea1n, \u0111\u1ea3m b\u1ea3o ho\u1ea1t \u0111\u1ed9ng \u1ed5n \u0111\u1ecbnh v\u00e0 t\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t h\u1ec7 th\u1ed1ng.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">ITviec hy v\u1ecdng b\u00e0i vi\u1ebft tr\u00ean \u0111\u00e3 cung c\u1ea5p cho b\u1ea1n \u0111\u1ea7y \u0111\u1ee7 th\u00f4ng tin \u0111\u1ec3 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu th\u00e0nh c\u00f4ng.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL l\u00e0 m\u1ed9t trong nh\u1eefng h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u1ed5 bi\u1ebfn nh\u1ea5t, \u0111\u01b0\u1ee3c bi\u1ebft \u0111\u1ebfn v\u1edbi s\u1ef1 \u1ed5n \u0111\u1ecbnh, t\u00ednh linh ho\u1ea1t v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng. Khi k\u1ebft h\u1ee3p v\u1edbi Ubuntu, m\u1ed9t h\u1ec7 \u0111i\u1ec1u h\u00e0nh m\u00e3 ngu\u1ed3n m\u1edf m\u1ea1nh m\u1ebd, b\u1ea1n s\u1ebd c\u00f3 m\u1ed9t m\u00f4i tr\u01b0\u1eddng l\u00e0m vi\u1ec7c hi\u1ec7u qu\u1ea3, ti\u1ec7n l\u1ee3i [&hellip;]<\/p>\n","protected":false},"author":209,"featured_media":79220,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-79135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft - ITviec Blog<\/title>\n<meta name=\"description\" content=\"MySQL khi k\u1ebft h\u1ee3p v\u1edbi Ubuntu s\u1ebd t\u1ea1o ra m\u1ed9t m\u00f4i tr\u01b0\u1eddng qu\u1ea3n l\u00fd d\u1eef li\u1ec7u hi\u1ec7u qu\u1ea3. V\u1eady th\u00ec b\u01b0\u1edbc \u0111\u1ea7u ti\u00ean c\u1ea7n l\u00e0m l\u00e0 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft\" \/>\n<meta property=\"og:description\" content=\"MySQL l\u00e0 m\u1ed9t trong nh\u1eefng h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u1ed5 bi\u1ebfn nh\u1ea5t, \u0111\u01b0\u1ee3c bi\u1ebft \u0111\u1ebfn v\u1edbi s\u1ef1 \u1ed5n \u0111\u1ecbnh, t\u00ednh linh ho\u1ea1t v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng. Khi k\u1ebft h\u1ee3p v\u1edbi Ubuntu, m\u1ed9t\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-30T04:56:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/MySQL-Ubuntu-vippro.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"790\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"M\u1ef9 Duy\u00ean\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"M\u1ef9 Duy\u00ean\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft - ITviec Blog","description":"MySQL khi k\u1ebft h\u1ee3p v\u1edbi Ubuntu s\u1ebd t\u1ea1o ra m\u1ed9t m\u00f4i tr\u01b0\u1eddng qu\u1ea3n l\u00fd d\u1eef li\u1ec7u hi\u1ec7u qu\u1ea3. V\u1eady th\u00ec b\u01b0\u1edbc \u0111\u1ea7u ti\u00ean c\u1ea7n l\u00e0m l\u00e0 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/","og_locale":"vi_VN","og_type":"article","og_title":"MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft","og_description":"MySQL l\u00e0 m\u1ed9t trong nh\u1eefng h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u1ed5 bi\u1ebfn nh\u1ea5t, \u0111\u01b0\u1ee3c bi\u1ebft \u0111\u1ebfn v\u1edbi s\u1ef1 \u1ed5n \u0111\u1ecbnh, t\u00ednh linh ho\u1ea1t v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng. Khi k\u1ebft h\u1ee3p v\u1edbi Ubuntu, m\u1ed9t","og_url":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2024-09-30T04:56:24+00:00","og_image":[{"width":1500,"height":790,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/MySQL-Ubuntu-vippro.jpg","type":"image\/jpeg"}],"author":"M\u1ef9 Duy\u00ean","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"M\u1ef9 Duy\u00ean","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"19 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/"},"author":{"name":"M\u1ef9 Duy\u00ean","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/73733c0725c7e39e696a896bd1abe2d7"},"headline":"MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft","datePublished":"2024-09-30T04:56:24+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/"},"wordCount":4699,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/MySQL-Ubuntu-vippro.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/","url":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/","name":"MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/MySQL-Ubuntu-vippro.jpg","datePublished":"2024-09-30T04:56:24+00:00","description":"MySQL khi k\u1ebft h\u1ee3p v\u1edbi Ubuntu s\u1ebd t\u1ea1o ra m\u1ed9t m\u00f4i tr\u01b0\u1eddng qu\u1ea3n l\u00fd d\u1eef li\u1ec7u hi\u1ec7u qu\u1ea3. V\u1eady th\u00ec b\u01b0\u1edbc \u0111\u1ea7u ti\u00ean c\u1ea7n l\u00e0m l\u00e0 c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/MySQL-Ubuntu-vippro.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/09\/MySQL-Ubuntu-vippro.jpg","width":1500,"height":790,"caption":"MySQL Ubuntu - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/cach-cai-dat-mysql-tren-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"MySQL Ubuntu: H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t MySQL tr\u00ean Ubuntu chi ti\u1ebft"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/73733c0725c7e39e696a896bd1abe2d7","name":"M\u1ef9 Duy\u00ean","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","caption":"M\u1ef9 Duy\u00ean"},"url":"https:\/\/itviec.com\/blog\/author\/my-duyen\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/79135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/209"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=79135"}],"version-history":[{"count":0,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/79135\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/79220"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=79135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=79135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=79135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}