{"id":48,"date":"2021-01-04T11:30:29","date_gmt":"2021-01-04T11:30:29","guid":{"rendered":"https:\/\/blog.gwlin.com\/?p=48"},"modified":"2023-03-29T18:59:54","modified_gmt":"2023-03-29T18:59:54","slug":"Linux\u8fd0\u7ef4\u5e38\u7528\u547d\u4ee4\uff08\u6301\u7eed\u66f4\u65b0\uff09","status":"publish","type":"post","link":"https:\/\/www.gwlin.com\/blog\/posts\/48","title":{"rendered":"Linux\u8fd0\u7ef4\u5e38\u7528\u547d\u4ee4\uff08\u6301\u7eed\u66f4\u65b0\uff09"},"content":{"rendered":"<p class=\"has-medium-font-size\">Mysql\u76f8\u5173<\/p>\n<p>1\u3001\u521b\u5efa\u6570\u636e\u5e93<\/p>\n<pre class=\"wp-block-code\"><code class=\"prettyprint\"  lang=\"sql\" class=\"language-sql\">CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;<\/code><\/pre>\n<p>2\u3001\u6dfb\u52a0\u7528\u6237<\/p>\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE USER &#039;newuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;password&#039;;<\/code><\/pre>\n<p>3\u3001\u7528\u6237\u6388\u6743<\/p>\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">GRANT ALL PRIVILEGES ON * . * TO &#039;newuser&#039;@&#039;localhost&#039;;<\/code><\/pre>\n<p>4\u3001\u4e34\u65f6\u53d6\u6d88 full group by<\/p>\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,&#039;ONLY_FULL_GROUP_BY&#039;,&#039;&#039;));<\/code><\/pre>\n<p class=\"has-medium-font-size\">Git\u76f8\u5173<\/p>\n<p>1\u3001\u5ffd\u7565\u6587\u4ef6\u6743\u9650\u53d8\u5316<\/p>\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"># \u5355\u4e2a\u9879\u76ee\u8bbe\u7f6e\r\ngit config core.fileMode false\r\n# \u5168\u5c40\u8bbe\u7f6e\r\ngit config --global core.fileMode false<\/code><\/pre>\n<p>2\u3001\u9884\u89c8 git pull \u5c06\u66f4\u6539\u7684\u6587\u4ef6<\/p>\n<pre class=\"wp-block-code\"><code class=\"prettyprint\"  lang=\"bash\" class=\"language-bash\">git fetch &amp;&amp; git diff --name-only ..origin<\/code><\/pre>\n<p class=\"has-medium-font-size\">Linux\u76f8\u5173<\/p>\n<p>1\u3001\u6dfb\u52a0\u7528\u6237\u5230\u7528\u6237\u7ec4<\/p>\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">usermod -a -G group user<\/code><\/pre>\n<p>2\u3001\u538b\u7f29zip\u6587\u4ef6\u5939<\/p>\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"> zip -r \u6587\u4ef6\u540d \u6587\u4ef6\u5939<\/code><\/pre>\n<p>3\u3001\u9012\u5f52\u4fee\u6539\u76ee\u5f55\u6743\u9650<\/p>\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">find &lt;\u76ee\u5f55&gt; -type d -exec chmod &lt;755&gt; {} \\;<\/code><\/pre>\n<p>4\u3001\u9012\u5f52\u4fee\u6539\u6587\u4ef6\u6743\u9650<\/p>\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">find &lt;\u76ee\u5f55&gt; -type f -exec chmod &lt;644&gt; {} \\;<\/code><\/pre>\n<p>5\u3001SCP\u4e0a\u4f20\u6587\u4ef6<\/p>\n<pre class=\"wp-block-code\"><code class=\"\">scp -P \u7aef\u53e3 \u672c\u5730\u8def\u5f84 \u7528\u6237@\u4e3b\u673a:\u8fdc\u7a0b\u7edd\u5bf9\u8def\u5f84<\/code><\/pre>\n<p>6\u3001SCP\u4e0b\u8f7d\u6587\u4ef6<\/p>\n<pre class=\"wp-block-code\"><code class=\"\">scp -P \u7aef\u53e3 \u7528\u6237@\u4e3b\u673a:\u8fdc\u7a0b\u7edd\u5bf9\u8def\u5f84 \u672c\u5730\u8def\u5f84<\/code><\/pre>\n<p>7\u3001ufw\u5141\u8bb8\u7aef\u53e3\u8303\u56f4<\/p>\n<pre><code class=\"Bash\">&lt;span class=&quot;hljs-attribute&quot;&gt;ufw&lt;\/span&gt; &lt;span class=&quot;hljs-literal&quot;&gt;allow&lt;\/span&gt; &lt;span class=&quot;hljs-number&quot;&gt;1234&lt;\/span&gt;:&lt;span class=&quot;hljs-number&quot;&gt;5678&lt;\/span&gt;\/tcp<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mysql\u76f8\u5173 1\u3001\u521b\u5efa\u6570\u636e\u5e93 CREATE DATABASE mydatabase CHARACTER SE [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[179],"tags":[189],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-notes","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":0,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}