{"id":77,"date":"2025-11-16T13:48:04","date_gmt":"2025-11-16T13:48:04","guid":{"rendered":"https:\/\/blogs.giamkichsan.com\/?p=77"},"modified":"2025-11-16T13:48:05","modified_gmt":"2025-11-16T13:48:05","slug":"centos-cach-cai-dat-mysql-mysql-community-server","status":"publish","type":"post","link":"https:\/\/blogs.giamkichsan.com\/index.php\/2025\/11\/16\/centos-cach-cai-dat-mysql-mysql-community-server\/","title":{"rendered":"Centos &#8211; C\u00e1ch c\u00e0i \u0111\u1eb7t MySQL (MySQL Community Server)"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\ud83d\udfe6 <strong>B\u01b0\u1edbc 1: C\u00e0i \u0111\u1eb7t MySQL Repository cho EL9<\/strong><\/h1>\n\n\n\n<p>Ch\u1ea1y l\u1ec7nh sau:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install https:\/\/dev.mysql.com\/get\/mysql80-community-release-el9-1.noarch.rpm\n<\/code><\/pre>\n\n\n\n<p>C\u1eadp nh\u1eadt repo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update -y\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udfe6 <strong>B\u01b0\u1edbc 2: C\u00e0i \u0111\u1eb7t MySQL Server<\/strong><\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y mysql-community-server\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udfe6 <strong>B\u01b0\u1edbc 3: Kh\u1edfi \u0111\u1ed9ng v\u00e0 b\u1eadt MySQL<\/strong><\/h1>\n\n\n\n<p>Kh\u1edfi \u0111\u1ed9ng:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start mysqld\n<\/code><\/pre>\n\n\n\n<p>B\u1eadt t\u1ef1 \u0111\u1ed9ng ch\u1ea1y khi kh\u1edfi \u0111\u1ed9ng:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable mysqld\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udfe6 <strong>B\u01b0\u1edbc 4: L\u1ea5y m\u1eadt kh\u1ea9u root t\u1ea1m th\u1eddi<\/strong><\/h1>\n\n\n\n<p>MySQL t\u1ea1o password t\u1ea1m trong log:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo grep 'temporary password' \/var\/log\/mysqld.log\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udfe6 <strong>B\u01b0\u1edbc 5: B\u1ea3o m\u1eadt MySQL<\/strong><\/h1>\n\n\n\n<p>Ch\u1ea1y script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation\n<\/code><\/pre>\n\n\n\n<p>Thi\u1ebft l\u1eadp:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Nh\u1eadp m\u1eadt kh\u1ea9u t\u1ea1m<\/li>\n\n\n\n<li>\u0110\u1eb7t m\u1eadt kh\u1ea9u root m\u1edbi<\/li>\n\n\n\n<li>T\u1eaft anonymous user \u2192 Y<\/li>\n\n\n\n<li>T\u1eaft remote root login \u2192 Y (n\u1ebfu server internet)<\/li>\n\n\n\n<li>X\u00f3a test database \u2192 Y<\/li>\n\n\n\n<li>Reload privilege tables \u2192 Y<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udfe6 <strong>B\u01b0\u1edbc 6: \u0110\u0103ng nh\u1eadp MySQL<\/strong><\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u2714 Ki\u1ec3m tra MySQL<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql --version<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>\ud83d\udfe6 B\u01b0\u1edbc 1: C\u00e0i \u0111\u1eb7t MySQL Repository cho EL9 Ch\u1ea1y l\u1ec7nh sau: C\u1eadp nh\u1eadt repo: \ud83d\udfe6 B\u01b0\u1edbc 2: C\u00e0i \u0111\u1eb7t MySQL Server \ud83d\udfe6 B\u01b0\u1edbc 3: <a class=\"mh-excerpt-more\" href=\"https:\/\/blogs.giamkichsan.com\/index.php\/2025\/11\/16\/centos-cach-cai-dat-mysql-mysql-community-server\/\" title=\"Centos &#8211; C\u00e1ch c\u00e0i \u0111\u1eb7t MySQL (MySQL Community Server)\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-mysql-he-quan-tri-co-so-du-lieu"],"_links":{"self":[{"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":1,"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/posts\/77\/revisions\/78"}],"wp:attachment":[{"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.giamkichsan.com\/index.php\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}