{"id":1851,"date":"2022-09-14T11:17:17","date_gmt":"2022-09-14T02:17:17","guid":{"rendered":"https:\/\/www.kwonline.org\/memo2\/?p=1851"},"modified":"2022-10-26T14:42:26","modified_gmt":"2022-10-26T05:42:26","slug":"install-mysql8-on-ubuntu-20_04-and-reduce-mem-usage","status":"publish","type":"post","link":"https:\/\/www.kwonline.org\/memo2\/2022\/09\/14\/install-mysql8-on-ubuntu-20_04-and-reduce-mem-usage\/","title":{"rendered":"Ubuntu20.04: MySQL8.0 \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u524a\u6e1b"},"content":{"rendered":"<p>&nbsp;<br \/>\nAzure VM \u306e Standard B1ls \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067 Ubuntu \u306b MySQL \u3092\u5165\u308c\u3088\u3046\u3068\u3057\u305f\u3089\u30e1\u30e2\u30ea\u4e0d\u8db3\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u306a\u304b\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002<br \/>\n\u6700\u7d42\u7684\u306b\u306f B1ls \u306e RAM 500MB \u3067\u52d5\u304b\u305b\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3051\u3069\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u3068\u306b\u304b\u304f MySQL 8.0 \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3044<\/h2>\n<p>\u307e\u305a\u3001 MySQL8.0 \u306f RAM 500MB \u3060\u3068\u30e1\u30e2\u30ea\u4e0d\u8db3\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u306a\u3044\uff57<\/p>\n<p>apt \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3053\u3046\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u2193<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/67564215\/problems-installing-mysql-on-ubuntu-20-04\/67564442\" rel=\"noopener\" target=\"_blank\">Problems installing MySQL on Ubuntu 20.04 &#8211; Stack Overflow<\/a><\/p>\n<p>\u3067\u3001\u5fdc\u6025\u51e6\u7f6e\u306f RAM \u3092 1GB \u4ee5\u4e0a\u78ba\u4fdd\u3057\u3066\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070 OK.<br \/>\n\u30de\u30b7\u30f3\u30b5\u30a4\u30ba\u3092 Standard B1s (RAM 1GB) \u306b\u5909\u66f4\u3057\u305f\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>mysql_secure_installation \u3067\u30a8\u30e9\u30fc\u304c\u51fa\u308b<\/h2>\n<p>\u7d9a\u3044\u3066 mysql_secure_installation \u3092\u5b9f\u884c\u3057\u305f\u3089\u3001\u4eca\u5ea6\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3067\u304d\u306a\u3044\u3002<\/p>\n<p>sudo mysql_secure_installation \u3092\u3059\u308b\u3068\u3053\u3046\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u2193<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/72103302\/mysql-installation-on-ubuntu-20-04-error-when-using-mysql-secure-installation\" rel=\"noopener\" target=\"_blank\">MySQL installation on Ubuntu 20.04 error when using mysql_secure_installation &#8211; Stack Overflow<\/a><\/p>\n<p>\u5bfe\u7b56\u306f\u4e0a\u8a18\u30ea\u30f3\u30af\u5148\u306b\u66f8\u3044\u3066\u3042\u308b\u3068\u304a\u308a MySQL \u306b root \u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3001 ALTER \u30b3\u30de\u30f3\u30c9\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30bb\u30c3\u30c8\u3057\u3066\u304b\u3089\u518d\u3073 mysql_secure_installation \u3092\u5b9f\u884c\u3059\u308c\u3070 OK.<\/p>\n<p>&nbsp;<\/p>\n<h2>MySQL 8.0 \u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6e1b\u3089\u3059<\/h2>\n<p>\u6700\u5f8c\u306b\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6e1b\u3089\u3059\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068OS\u5168\u4f53\u3067 600MB \u4ee5\u4e0a\u30e1\u30e2\u30ea\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u306e\u307e\u307e\u3060\u3068 B1ls \u30de\u30b7\u30f3\u3067\u306f\u30e1\u30e2\u30ea\u4e0d\u8db3\u3067\u52d5\u304b\u306a\u3044\u3002<\/p>\n<p>\/etc\/mysql\/mysql.conf.d\/mysqld.cnf \u3092\u7de8\u96c6\u3057\u3066\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u6e1b\u3089\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# mysqld.cnf\r\nkey_buffer_size = 8M #16M \u304b\u3089\u5909\u66f4\r\n\r\n#\u305d\u3057\u3066\u4e0b\u8a18\u3092\u8ffd\u52a0\r\nthread_stack = 256K\r\nperformance_schema = 0\r\n<\/pre>\n<p>\u203b2022-10-26\u8a02\u6b63 thread_stack = 128K \u3060\u3068Thread Stack Overrun error \u304c\u51fa\u3066\u30b3\u30b1\u308b\u306e\u3067 256K \u306b\u5909\u66f4<\/p>\n<p>\u3053\u308c\u3067 MySQL \u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001RAM\u4f7f\u7528\u91cf\u304c\u4e00\u6c17\u306b\u6e1b\u3063\u305f\u3002<br \/>\nfree \u3067\u898b\u305f\u3089\u3053\u3046\u3060\u3063\u305f\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ free -m\r\n              total        used        free      shared  buff\/cache   available\r\nMem:            402         295           4          23         102          63\r\nSwap:          2047         326        1721\r\n<\/pre>\n<p>300MB \u5f31\u307e\u3067\u6e1b\u3089\u305b\u305f\u3002<br \/>\n\u3053\u3053\u307e\u3067\u6765\u305f\u3089\u3001\u3042\u3068\u306f\u30de\u30b7\u30f3\u30b5\u30a4\u30ba\u3092\u518d\u3073 B1ls \u306e RAM 500MB \u30de\u30b7\u30f3\u306b\u5909\u66f4\u3059\u308c\u3070 OK.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Azure VM \u306e Standard B1ls \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067 Ubuntu \u306b MySQL \u3092\u5165\u308c\u3088\u3046\u3068\u3057\u305f\u3089\u30e1\u30e2\u30ea\u4e0d\u8db3\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51fa\u6765\u306a\u304b\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002 \u6700\u7d42\u7684\u306b\u306f B1ls \u306e RAM 500MB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,8],"tags":[],"class_list":["post-1851","post","type-post","status-publish","format-standard","hentry","category-azure","category-linux"],"_links":{"self":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/comments?post=1851"}],"version-history":[{"count":6,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1851\/revisions"}],"predecessor-version":[{"id":1864,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/posts\/1851\/revisions\/1864"}],"wp:attachment":[{"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/media?parent=1851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/categories?post=1851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kwonline.org\/memo2\/wp-json\/wp\/v2\/tags?post=1851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}