{"id":183640,"date":"2024-11-10T06:30:19","date_gmt":"2024-11-09T22:30:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/183640\/"},"modified":"2024-11-10T06:30:20","modified_gmt":"2024-11-09T22:30:20","slug":"%e4%bd%bf%e7%94%a8cygwin%e8%bc%95%e9%ac%86%e6%90%ad%e5%bb%ba%e6%95%b8%e6%93%9a%e5%ba%ab%e7%92%b0%e5%a2%83-cygwin-%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/183640\/","title":{"rendered":"\u4f7f\u7528Cygwin\u8f15\u9b06\u642d\u5efa\u6578\u64da\u5eab\u74b0\u5883 (cygwin \u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"%e4%bd%bf%e7%94%a8cygwin%e8%bc%95%e9%ac%86%e6%90%ad%e5%bb%ba%e6%95%b8%e6%93%9a%e5%ba%ab%e7%92%b0%e5%a2%83-KmbIlGTYkD\">\u4f7f\u7528Cygwin\u8f15\u9b06\u642d\u5efa\u6578\u64da\u5eab\u74b0\u5883<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u958b\u767c\u74b0\u5883\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u4f7f\u7528\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u666e\u904d\u3002\u7121\u8ad6\u662f\u958b\u767c\u5c0f\u578b\u61c9\u7528\u9084\u662f\u5927\u578b\u7cfb\u7d71\uff0c\u6578\u64da\u5eab\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u3002\u5c0d\u65bcWindows\u7528\u6236\u4f86\u8aaa\uff0cCygwin\u662f\u4e00\u500b\u975e\u5e38\u6709\u7528\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u8b93\u7528\u6236\u5728Windows\u74b0\u5883\u4e2d\u904b\u884c\u985eUnix\u7684\u61c9\u7528\u7a0b\u5e8f\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528Cygwin\u8f15\u9b06\u642d\u5efa\u6578\u64da\u5eab\u74b0\u5883\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%afcygwin%ef%bc%9f-KmbIlGTYkD\">\u4ec0\u9ebc\u662fCygwin\uff1f<\/h2>\n<p>Cygwin\u662f\u4e00\u500b\u70baWindows\u63d0\u4f9b\u985eUnix\u74b0\u5883\u7684\u5de5\u5177\uff0c\u5b83\u5305\u542b\u4e86\u4e00\u500b\u5927\u578b\u7684GNU\u548c\u958b\u6e90\u5de5\u5177\u96c6\u3002\u901a\u904eCygwin\uff0c\u7528\u6236\u53ef\u4ee5\u5728Windows\u4e0a\u904b\u884cLinux\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u9019\u5c0d\u65bc\u958b\u767c\u8005\u4f86\u8aaa\u662f\u975e\u5e38\u65b9\u4fbf\u7684\u3002Cygwin\u4e0d\u50c5\u652f\u6301\u591a\u7a2e\u7de8\u7a0b\u8a9e\u8a00\uff0c\u9084\u53ef\u4ee5\u5b89\u88dd\u5404\u7a2e\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u5982MySQL\u3001PostgreSQL\u7b49\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9dcygwin-KmbIlGTYkD\">\u5b89\u88ddCygwin<\/h2>\n<p>\u5728\u958b\u59cb\u642d\u5efa\u6578\u64da\u5eab\u74b0\u5883\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5b89\u88ddCygwin\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u8a2a\u554fCygwin\u7684\u5b98\u65b9\u7db2\u7ad9\uff08<a href=\"https:\/\/www.cygwin.com\/\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/www.cygwin.com\/<\/a>\uff09\u4e0b\u8f09\u5b89\u88dd\u7a0b\u5e8f\u3002<\/li>\n<li>\u904b\u884c\u5b89\u88dd\u7a0b\u5e8f\uff0c\u9078\u64c7\u5b89\u88dd\u8def\u5f91\u548c\u93e1\u50cf\u6e90\u3002<\/li>\n<li>\u5728\u9078\u64c7\u5305\u7684\u968e\u6bb5\uff0c\u641c\u7d22\u4e26\u9078\u64c7\u9700\u8981\u7684\u5305\uff0c\u4f8b\u5982\uff1a<code>gcc<\/code>\u3001<code>make<\/code>\u3001<code>git<\/code>\u7b49\u3002<\/li>\n<li>\u5b8c\u6210\u5b89\u88dd\u5f8c\uff0c\u555f\u52d5Cygwin\u7d42\u7aef\u3002<\/li>\n<\/ol>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e6%95%b8%e6%93%9a%e5%ba%ab-KmbIlGTYkD\">\u5b89\u88dd\u6578\u64da\u5eab<\/h2>\n<p>\u4ee5MySQL\u70ba\u4f8b\uff0c\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u5728Cygwin\u7d42\u7aef\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u5305\u5217\u8868\uff1a<\/li>\n<pre><code>apt-cyg update<\/code><\/pre>\n<li>\u5b89\u88ddMySQL\uff1a<\/li>\n<pre><code>apt-cyg install mysql<\/code><\/pre>\n<li>\u555f\u52d5MySQL\u670d\u52d9\uff1a<\/li>\n<pre><code>mysql.server start<\/code><\/pre>\n<li>\u8a2d\u7f6eMySQL\u7684root\u5bc6\u78bc\uff1a<\/li>\n<pre><code>mysql_secure_installation<\/code><\/pre>\n<\/ol>\n<h2 id=\"%e9%85%8d%e7%bd%ae%e6%95%b8%e6%93%9a%e5%ba%ab-KmbIlGTYkD\">\u914d\u7f6e\u6578\u64da\u5eab<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u5165MySQL\u547d\u4ee4\u884c\u754c\u9762\uff1a<\/p>\n<pre><code>mysql -u root -p<\/code><\/pre>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u6578\u64da\u5eab\u3001\u7528\u6236\u4ee5\u53ca\u8a2d\u7f6e\u6b0a\u9650\u3002\u4f8b\u5982\uff0c\u5275\u5efa\u4e00\u500b\u540d\u70ba<code>test_db<\/code>\u7684\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>CREATE DATABASE test_db;<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u7528\u6236\u4e26\u6388\u4e88\u6b0a\u9650\uff1a<\/p>\n<pre><code>CREATE USER 'test_user'@'localhost' IDENTIFIED BY 'password';<\/code><\/pre>\n<pre><code>GRANT ALL PRIVILEGES ON test_db.* TO 'test_user'@'localhost';<\/code><\/pre>\n<h2 id=\"%e4%bd%bf%e7%94%a8%e5%85%b6%e4%bb%96%e6%95%b8%e6%93%9a%e5%ba%ab-KmbIlGTYkD\">\u4f7f\u7528\u5176\u4ed6\u6578\u64da\u5eab<\/h2>\n<p>\u9664\u4e86MySQL\uff0c\u60a8\u9084\u53ef\u4ee5\u4f7f\u7528Cygwin\u5b89\u88dd\u5176\u4ed6\u6578\u64da\u5eab\uff0c\u5982PostgreSQL\u3002\u5b89\u88dd\u6b65\u9a5f\u985e\u4f3c\uff0c\u53ea\u9700\u5c07\u76f8\u61c9\u7684\u5305\u540d\u7a31\u66ff\u63db\u70ba<code>postgresql<\/code>\u5373\u53ef\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-KmbIlGTYkD\">\u7e3d\u7d50<\/h2>\n<p>\u4f7f\u7528Cygwin\u642d\u5efa\u6578\u64da\u5eab\u74b0\u5883\u662f\u4e00\u500b\u7c21\u55ae\u800c\u6709\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u7279\u5225\u662f\u5c0d\u65bcWindows\u7528\u6236\u4f86\u8aaa\u3002\u901a\u904e\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u5b89\u88dd\u548c\u914d\u7f6eMySQL\u6216\u5176\u4ed6\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u70ba\u60a8\u7684\u958b\u767c\u5de5\u4f5c\u63d0\u4f9b\u652f\u6301\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u5f37\u5927\u7684\u670d\u52d9\u5668\u8cc7\u6e90\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u7ba1\u7406\u548c\u904b\u884c\u60a8\u7684\u6578\u64da\u5eab\u61c9\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528Cygwin\u8f15\u9b06\u642d\u5efa\u6578\u64da\u5eab\u74b0\u5883\uff0c\u5feb\u901f\u914d\u7f6e\u548c\u7ba1\u7406\u6578\u64da\u5eab\uff0c\u63d0\u5347\u958b\u767c\u6548\u7387\uff0c\u9069\u5408\u5404\u985e\u958b\u767c\u8005\u4f7f\u7528\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-183640","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/183640","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=183640"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/183640\/revisions"}],"predecessor-version":[{"id":183641,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/183640\/revisions\/183641"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=183640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=183640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=183640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}