{"id":174,"date":"2024-06-30T00:37:48","date_gmt":"2024-06-29T22:37:48","guid":{"rendered":"https:\/\/blog.nickywin.com\/?p=174"},"modified":"2026-06-05T16:24:00","modified_gmt":"2026-06-05T14:24:00","slug":"install-mysql-on-fedora","status":"publish","type":"post","link":"https:\/\/blog.nickywin.com\/install-mysql-on-fedora\/","title":{"rendered":"\u5982\u4f55\u5728Fedora \u4e0a\u5b89\u88c5MySQL"},"content":{"rendered":"<figure class=\"wp-block-post-featured-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/blog.nickywin.com\/wp-content\/uploads\/2024\/06\/fedora.jpg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"270\" data-original=\"https:\/\/blog.nickywin.com\/wp-content\/uploads\/2024\/06\/fedora.jpg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" class=\"attachment-post-thumbnail size-post-thumbnail no-lazy wp-post-image\" alt=\"\" style=\"object-fit:cover;\"  sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/div><\/figure>\n\n\n<p>\u7b2c 1 \u6b65\u3002\u5728\u7ee7\u7eed\u4e4b\u524d\uff0c\u8bf7\u66f4\u65b0\u60a8\u7684 Fedora&nbsp;&nbsp;\u64cd\u4f5c\u7cfb\u7edf\u4ee5\u786e\u4fdd\u6240\u6709\u73b0\u6709&nbsp;\u8f6f\u4ef6\u5305\u90fd\u662f\u6700\u65b0\u7684\u3002\u4f7f\u7528\u6b64\u547d\u4ee4\u66f4\u65b0\u670d\u52a1\u5668&nbsp;\u8f6f\u4ef6\u5305\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf upgrade\nsudo dnf update<\/code><\/pre>\n\n\n\n<p>\u7b2c 2 \u6b65\u3002\u5728 Fedora  \u4e0a&nbsp;\u5b89\u88c5&nbsp;MySQL\u3002<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cMySQL \u8f6f\u4ef6\u5305\u4e0d\u5728 Fedora 37 \u7684\u9ed8\u8ba4\u5b58\u50a8\u5e93\u4e2d\u3002\u73b0\u5728\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5c06 MySQL \u5b58\u50a8\u5e93\u6dfb\u52a0\u5230\u60a8\u7684 Fedora \u7cfb\u7edf\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install https:\/\/dev.mysql.com\/get\/mysql80-community-release-fc37-1.noarch.rpm<\/code><\/pre>\n\n\n\n<p>\u6dfb\u52a0 MySQL Yum \u4ed3\u5e93\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5728 Fedora 37 \u7cfb\u7edf\u4e0a<a href=\"https:\/\/www.xtuos.com\/214619.html#\">&nbsp;\u5b89\u88c5<\/a>&nbsp;MySQL\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install mysql-community-server<\/code><\/pre>\n\n\n\n<p>&nbsp;\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u901a\u8fc7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8 MySQL \u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start mysqld\nsudo systemctl enable mysqld<\/code><\/pre>\n\n\n\n<p>\u8981\u9a8c\u8bc1\u662f\u5426\u5df2\u5b89\u88c5 MySQL\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql --version<\/code><\/pre>\n\n\n\n<p>\u7b2c 3 \u6b65\u3002\u4fdd\u62a4 MySQL \u5b89\u88c5\u3002<\/p>\n\n\n\n<p>MySQL\u9644\u5e26\u4e86\u4e00\u4e2a\u811a\u672c\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4fdd\u62a4\u5b89\u88c5\u3002\u82e5\u8981\u8fd0\u884c\u6b64\u811a\u672c\uff0c\u8bf7\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>\u6b64\u547d\u4ee4\u5c06\u542f\u52a8MySQL\u5b89\u5168<a href=\"https:\/\/www.xtuos.com\/214619.html#\">&nbsp;\u5b89\u88c5<\/a>\u5411\u5bfc\uff0c\u8be5\u5411\u5bfc\u5c06\u6307\u5bfc\u60a8\u5b8c\u6210\u4fdd\u62a4MySQL\u670d\u52a1\u5668\u7684\u8fc7\u7a0b\u3002\u7cfb\u7edf\u5c06\u63d0\u793a\u60a8\u8bbe\u7f6e root \u5bc6\u7801\u3001\u5220\u9664\u533f\u540d\u7528\u6237\u3001\u7981\u7528\u8fdc\u7a0b root \u767b\u5f55\u4ee5\u53ca\u5220\u9664\u6d4b\u8bd5\u6570\u636e\u5e93\u3002\u6309\u7167\u63d0\u793a\u5b8c\u6210\u8bbe\u7f6e\u3002<\/p>\n\n\n\n<p>\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Securing the MySQL server deployment.\n\nEnter password for user root: \n\nThe existing password for the user account root has expired. Please set a new password.\n\nNew password: \n\nRe-enter new password: \nThe 'validate_password' component is installed on the server.\nThe subsequent steps will run with the existing configuration\nof the component.\nUsing existing password for root.\n\nEstimated strength of the password: 100 \nChange the password for root ? ((Press y|Y for Yes, any other key for No) : y\n\nNew password: \n\nRe-enter new password: \n\nEstimated strength of the password: 100 \nDo you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y\nBy default, a MySQL installation has an anonymous user,\nallowing anyone to log into MySQL without having to have\na user account created for them. This is intended only for\ntesting, and to make the installation go a bit smoother.\nYou should remove them before moving into a production\nenvironment.\n\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : y\nSuccess.\n\nNormally, root should only be allowed to connect from\n'localhost'. This ensures that someone cannot guess at\nthe root password from the network.\n\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : y\nSuccess.\n\nBy default, MySQL comes with a database named 'test' that\nanyone can access. This is also intended only for testing,\nand should be removed before moving into a production\nenvironment.\n\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : y\n - Dropping test database...\nSuccess.\n\n - Removing privileges on test database...\nSuccess.\n\nReloading the privilege tables will ensure that all changes\nmade so far will take effect immediately.\n\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : y\nSuccess.\n\nAll done!<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c 1 \u6b65\u3002\u5728\u7ee7\u7eed\u4e4b\u524d\uff0c\u8bf7\u66f4\u65b0\u60a8\u7684 Fedora&nbsp;&nbsp;\u64cd\u4f5c\u7cfb\u7edf\u4ee5\u786e\u4fdd\u6240\u6709\u73b0\u6709&nbsp;\u8f6f\u4ef6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":210,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,7],"tags":[],"class_list":["post-174","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-my-code-diary","category-linux-tinkering"],"_links":{"self":[{"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/posts\/174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/comments?post=174"}],"version-history":[{"count":5,"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":222,"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/posts\/174\/revisions\/222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/media\/210"}],"wp:attachment":[{"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/categories?post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nickywin.com\/wp-json\/wp\/v2\/tags?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}