{"id":119,"date":"2018-03-19T22:09:12","date_gmt":"2018-03-19T13:09:12","guid":{"rendered":"http:\/\/www7390uo.sakura.ne.jp\/wordpress\/?p=119"},"modified":"2022-05-21T23:08:44","modified_gmt":"2022-05-21T14:08:44","slug":"mysql5-7-21%e3%82%92%e3%82%bd%e3%83%bc%e3%82%b9%e3%81%8b%e3%82%89%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/119","title":{"rendered":"MySQL5.7.21\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"\n<p>OS: Ubuntu Server 16.04<br>MySQL 5.7.21<\/p>\n\n\n\n<p>\u4e45\u3057\u304fMySQL\u306e\u30bd\u30fc\u30b9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u96e2\u308c\u3066\u3044\u305f\u306e\u3067\u30e1\u30e2\u3092\u6b8b\u3059\u3082\u306e\u3067\u3042\u308b\u3002\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306fconfigure\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u4ee5\u3063\u3066Makefile\u3092\u62f5\u3048\u3066\u3044\u305f\u3051\u308c\u3069\u3082\u3001\u8fd1\u9803\u306eMySQL\u306f\u3069\u3046\u3082<code>cmake<\/code>\u306e\u3088\u3046\u3067\u3042\u308b\u304b\u3089\u6b64\u308c\u3092\u4e88\u3081\u5c0e\u5165\u3057\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install cmake<\/pre>\n\n\n\n<p>\u307e\u305f<code>libncurses5-dev<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u7121\u3044\u3068cmake\u5b9f\u65bd\u4e2d\u306b\u4e0b\u8a18\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u73fe\u308c\u3066\u51e6\u7406\u304c\u53d6\u308a\u3084\u3081\u3068\u306a\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CMake Error at cmake\/readline.cmake:64 (MESSAGE):\n  Curses library not found.  Please install appropriate package,\n\n      remove CMakeCache.txt and rerun cmake.On Debian\/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.<\/pre>\n\n\n\n<p>\u3053\u308c\u3092\u9632\u3050\u305f\u3081\u306b<code>libncurses5-dev<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u3082\u4f75\u305b\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u3002\u306a\u304aRedHat\u7cfb\u306eOS\u3067\u3042\u308c\u3070<code>ncurses-devel<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt install libncurses5-dev<\/pre>\n\n\n\n<p>\u3042\u3068\u306f<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/installing-source-distribution.html\">\u516c\u5f0f\u306e\u6587\u732e<\/a>\u3092\u624b\u304c\u304b\u308a\u306b\u4f5c\u696d\u3092\u9032\u3081\u3066\u3086\u304f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo useradd -r -s \/bin\/false mysql\n$ wget -c https:\/\/dev.mysql.com\/get\/Downloads\/MySQL-5.7\/mysql-5.7.21.tar.gz\n$ wget -c https:\/\/dev.mysql.com\/downloads\/gpg\/?file=mysql-5.7.21.tar.gz -O mysql-5.7.21.tar.gz.asc\n$ gpg --recv-keys 5072E1F5\n$ gpg --verify mysql-5.7.21.tar.gz.asc\n$ tar zxvf mysql-5.7.21.tar.gz\n$ cd mysql-5.7.21\/\n$ mkdir bld\n$ cd bld\/<\/pre>\n\n\n\n<p>\u30d3\u30eb\u30c9\u306e\u7528\u610f\u304c\u6574\u3063\u305f\u3089cmake\u306e\u5b9f\u884c\u304b\u3089\u59cb\u3081\u308b\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5148\u3092\u6307\u5b9a\u3059\u308b<code>CMAKE_INSTALL_PREFIX<\/code>\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067<code>\/usr\/local\/mysql<\/code>\u3067\u3042\u308b\u65e8\u3001\u8a18\u8f09\u304c\u3042\u3063\u305f\u304b\u3089\u4f55\u3082\u6307\u5b9a\u305b\u305a\u306b\u3044\u305f\u306e\u3067\u3042\u308b\u3051\u308c\u3069\u3082\u3001\u4f55\u6545\u304b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u914d\u7f6e\u3055\u308c\u306a\u304b\u3063\u305f\u306e\u3067\u5ff5\u306e\u305f\u3081\u3044\u3061\u3044\u3061\u660e\u793a\u3057\u305f\u307b\u3046\u304c\u826f\u3055\u305d\u3046\u306a\u60c5\u52e2\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST=.\/boost\/ -DCMAKE_INSTALL_PREFIX=\/usr\/local\/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci\n$ make\n$ sudo make install\n$ cd \/usr\/local\/mysql\/\n$ sudo mkdir mysql-files\n$ sudo chown mysql:mysql mysql-files\/\n$ sudo chmod 750 mysql-files\/<\/pre>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u30c7\u30fc\u30bf\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u521d\u671f\u5316\u3092\u5b9f\u65bd\u3059\u308b\u3002\u3053\u3053\u3067\u307e\u308b\u304d\u308a\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\u3067\u751f\u6210\u3055\u308c\u305froot\u30e6\u30fc\u30b6\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5f97\u3089\u308c\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo bin\/mysqld --initialize --user=mysql\n<strong class=\"orange\">2018-03-19T02:49:10.755528Z 1 [Note] A temporary password is generated for root@localhost: Su&gt;-%Gnhz86z<\/strong>\n\n$ sudo bin\/mysql_ssl_rsa_setup\n$ sudo bin\/mysqld_safe --user=mysql &amp;\n$ sudo cp -v support-files\/mysql.server \/etc\/init.d\/mysql.server\n$ cd bin\/<\/pre>\n\n\n\n<p>\u3053\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u614b\u3068\u6709\u52b9\u671f\u9650\u304c\u5207\u3089\u3057\u3066\u3042\u308b\u305f\u3081\u306bMySQL\u3092\u788c\u306b\u64cd\u4f5c\u3067\u304d\u306a\u3044\u304b\u3089\u30ea\u30bb\u30c3\u30c8\u306e\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ .\/mysql -uroot -p\nmysql&gt; show databases;\n<strong class=\"orange\">ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.<\/strong><\/pre>\n\n\n\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u30ea\u30bb\u30c3\u30c8\u306b\u306f<code>set password<\/code>\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u767a\u884c\u3059\u308b\u3002\u3044\u3063\u305f\u3093\u30ea\u30bb\u30c3\u30c8\u3059\u308c\u3070MySQL\u306e\u64cd\u4f5c\u306f\u6063\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; set password = 'avava';\nQuery OK, 0 rows affected (0.00 sec)<\/pre>\n\n\n\n<p>\u3072\u3068\u307e\u305aMySQL\u3092\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4f5c\u696d\u306f\u7d42\u3044\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo .\/mysqladmin -uroot -p shutdown\nEnter password:\n2018-03-19T02:57:21.415800Z mysqld_safe mysqld from pid file \/usr\/local\/mysql\/data\/guro.pid ended<\/pre>\n\n\n\n<h3 class=\"link\">\u53c2\u8003:<\/h3>\n<ul>\n <li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/installing-source-distribution.html\">2.9.2 Installing MySQL Using a Standard Source Distribution<\/a><\/li>\n <li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.6\/ja\/source-configuration-options.html\">2.9.4 MySQL \u30bd\u30fc\u30b9\u69cb\u6210\u30aa\u30d7\u30b7\u30e7\u30f3<\/a><\/li>\n <li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.6\/ja\/alter-user.html\">13.7.1.1 ALTER USER \u69cb\u6587<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>OS: Ubuntu Server 16.04MySQL 5.7.21 \u4e45\u3057\u304fMySQL\u306e\u30bd\u30fc\u30b9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u96e2\u308c\u3066\u3044\u305f\u306e\u3067\u30e1\u30e2\u3092\u6b8b\u3059\u3082\u306e\u3067\u3042\u308b\u3002\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306fconfigure\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u4ee5\u3063\u3066Makefile\u3092\u62f5\u3048\u3066\u3044\u305f\u3051\u308c\u3069\u3082\u3001\u8fd1\u9803\u306eMySQL\u306f\u3069\u3046\u3082cmake\u306e\u3088\u3046\u3067\u3042\u308b\u304b\u3089\u6b64\u308c\u3092\u4e88\u3081\u5c0e\u5165\u3057\u3066\u304a\u304f\u3002 $ sudo apt install cmake \u307e\u305flibncurses5-de &#8230; <a title=\"MySQL5.7.21\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\" class=\"read-more\" href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/119\" aria-label=\"MySQL5.7.21\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":966,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[162],"tags":[164,165],"class_list":["post-119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-162","tag-mysql","tag-165"],"views":2774,"_links":{"self":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":0,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/media\/966"}],"wp:attachment":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}