{"id":4681,"date":"2026-09-10T13:30:01","date_gmt":"2026-09-10T04:30:01","guid":{"rendered":"https:\/\/www.kinryo.net\/?p=4681"},"modified":"2026-09-10T14:29:13","modified_gmt":"2026-09-10T05:29:13","slug":"%e5%a4%a7%e5%a4%89%e3%81%a0%e3%83%bc-mariadbmysql%e3%81%8c%e6%ad%bb%e3%82%93%e3%81%a0","status":"publish","type":"post","link":"https:\/\/www.kinryo.net\/?p=4681","title":{"rendered":"\u5927\u5909\u3060\u30fc mariadb(mysql)\u304c\u6b7b\u3093\u3060"},"content":{"rendered":"<p>\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u304c\u6b7b\u3093\u3060\u306e\u3067\u3001\u3082\u3061\u308d\u3093WEB\u30b5\u30fc\u30d0\u30fc\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044<\/p>\n<p>\u65e9\u6025\u306b\u76f4\u3057\u305f\u3044\u3002\u3067\u3082\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\uff08\u4ee5\u5f8c\uff1aDB)\u304c\u52d5\u3044\u3066\u3044\u306a\u3044\u306e\u3067mysqldump\u306f\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001DB\u306e\u30c7\u30fc\u30bf\u30fc\u9818\u57df\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\/var\/lib\/mysql\/\u3060\u304c\u79c1\u306f\u5909\u66f4\u3057\u3066\u3044\u308b\uff09\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\uff08\u5b9f\u306f\u6bce\u65e5\u5348\u524d3\u6642\u306b\u5168\u3066\u306eDB\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u6642\u70b9\u3067\u65e2\u306b\u5909\u66f4\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u3053\u304b\u3089\u30ea\u30b9\u30c8\u30a2\u306f\u3068\u308a\u3042\u3048\u305a\u3084\u3089\u306a\u3044\uff09DB\u304c\u6b62\u307e\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u5f8c<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo \\cp -af DB\u306e\u30c7\u30fc\u305fDIR\/* \u30b3\u30d4\u30fc\u5148\u306eDIR<\/span><br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo rm -rf DB\u306e\u30c7\u30fc\u30bfDIR\/*<\/span><br \/>\n\u3053\u308c\u3067\u3001DB\u3092\u30b9\u30bf\u30fc\u3068\u3059\u308b\u3068\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u81ea\u52d5\u3067\u4f5c\u308b\u306e\u3067<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo systemctl start mariadb<\/span><br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo systemctl status mariadb<br \/>\n<\/span>\u3067\u78ba\u8a8d\u3002OK\u52d5\u3044\u3066\u3044\u308b\u3002\u3067\u306f\u30ea\u30b9\u30c8\u30a2<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo \\cp -af\u00a0 \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u3066\u3042\u3063\u305fDIR\/* DB\u306e\u30c7\u30fc\u30bfDIR<\/span><br \/>\n\u305d\u3057\u3066DB\u30b9\u30bf\u30fc\u30c8<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo systemctl start mariadb<\/span><br \/>\n<span style=\"color: #ff6600;\">Job for mariadb.service failed because the control process exited with error code.<\/span><br \/>\n<span style=\"color: #ff6600;\">See &#8220;systemctl status mariadb.service&#8221; and &#8220;journalctl -xeu mariadb.service&#8221; for details.<\/span><br \/>\n\u3042\u3061\u3083\u30fc\u3001\u53c8\u30a8\u30e9\u30fc<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">journalctl -xeu mariadb.service<\/span><br \/>\n\u9577\u3044\u306e\u3067\u8981\u70b9<br \/>\n<span style=\"color: #ff6600;\">Database MariaDB is probably initialized in \/Rails\/mysql already, nothing is done.<\/span><br \/>\n<span style=\"color: #ff6600;\">If this is not the case, make sure the \/Rails\/mysql is empty before running mariadb-prepare-db-dir.<\/span><br \/>\n\u3088\u3046\u306f\u3001\u6700\u521d\u3068\u540c\u3058\u3001DB\u306e\u30c7\u30fc\u30bfDIR\u3092\u7a7a\u306b\u3057\u3066\u30b9\u30bf\u30fc\u30c8\u3057\u308d\u3068<br \/>\n\u3060\u3063\u305f\u3089\u30ed\u30b0\u3092\u898b\u3066\u307f\u3088\u3046<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo gedit \/var\/log\/mariadb\/mariadb.log<\/span><br \/>\n\u629c\u7c8b<\/p>\n<ul>\n<li>\n<p data-path-to-node=\"3,2,1,0,0\"><span style=\"color: #ff6600;\"><code data-path-to-node=\"3,2,1,0,0\" data-index-in-node=\"0\"><span style=\"color: #ff6600;\">[ERROR] File '\/Rails\/mysql\/aria_log_control' not found (Errcode: 13 \"Permission denied\")<\/span><\/code><\/span><\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"3,2,1,1,0\"><span style=\"color: #ff6600;\"><code data-path-to-node=\"3,2,1,1,0\" data-index-in-node=\"0\">[ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable<\/code><\/span><\/p>\n<\/li>\n<li><span style=\"color: #ff6600;\">[ERROR] InnoDB: Missing FILE_CHECKPOINT &#8230;<\/span><\/li>\n<\/ul>\n<p>ibdata1\u306f\u66f8\u304d\u8fbc\u307f\u53ef\u3060\u3057\u3001\u30aa\u30fc\u30ca\u30fc\u3082mysql \u306a\u306e\u306b\uff01<br \/>\n\u8272\u3005\u8abf\u3079\u308b\u3068\u3001\u30b3\u30d4\u30fc\u5143\u306e\u58ca\u308c\u305f\uff08\u307e\u305f\u306f\u6574\u5408\u6027\u306e\u5408\u308f\u306a\u3044\uff09<code data-path-to-node=\"3,3,1,0,0\" data-index-in-node=\"82\">ib_logfile<\/code> \u3092\u8aad\u307f\u8fbc\u3093\u3067\u3057\u307e\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u539f\u56e0\u3067\u3059\u3002\u3068\u3044\u3046\u3053\u3068\u3060\u3002\u3060\u3063\u305f\u3089\u3001ib_logfile\u3092\u6d88\u305b\u3070\u3001\u8d77\u52d5\u6642\u306b\u4f5c\u3063\u3066\u304f\u308c\u308b\u306e\u3067\u3001\u4e00\u69d8DB\u304c\u6b62\u307e\u3063\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u5f8c<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo rm -f \/Rails\/mysql\/ib_logfile*<\/span><br \/>\n\u5ff5\u306e\u70ba\u3001\u6240\u6709\u8005\u3084\u6a29\u9650\u3092\u8a2d\u5b9a<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo chown -R mysql:mysql \/Rails\/mysql<\/span><br \/>\n\u6a29\u9650\u306e\u5909\u66f4\uff08\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f755\u3001\u30d5\u30a1\u30a4\u30eb\u306f660\uff09<br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo find \/Rails\/mysql -type d -exec chmod 755 {} \\;<\/span><br \/>\n<span style=\"color: #ff6600;\">$<\/span> <span style=\"color: #008000;\">sudo find \/Rails\/mysql -type f -exec chmod 660 {} \\;<\/span><br \/>\n\u79c1\u306fSELinux\u306fdisable\u3057\u3066\u3044\u308b\u306e\u3067\u3001<br \/>\n<span style=\"color: #ff6600;\">$<\/span><span style=\"color: #008000;\"> sudo syatemctl start mariadb<\/span><br \/>\n<span style=\"color: #ff6600;\">$ <\/span><span style=\"color: #008000;\">sudo systemctl status mariadb<\/span><br \/>\n\u3084\u3063\u3068\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u306a\u3063\u305f\u306e\u3067\u3001WEB\u3092\u78ba\u8a8d\u3001<br \/>\n\u30d0\u30c3\u30c1\u30ea\uff0c\u52d5\u3044\u3066\u3044\u308b\u3002\u30d0\u30f3\u30b6\u30fc\u30a4<\/p>\n<p><code data-path-to-node=\"3,2,1,0,0\" data-index-in-node=\"0\"><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u304c\u6b7b\u3093\u3060\u306e\u3067\u3001\u3082\u3061\u308d\u3093WEB\u30b5\u30fc\u30d0\u30fc\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044 \u65e9\u6025\u306b\u76f4\u3057\u305f\u3044\u3002\u3067\u3082\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\uff08\u4ee5\u5f8c\uff1aDB)\u304c\u52d5\u3044\u3066\u3044\u306a\u3044\u306e\u3067mysqldump\u306f\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001DB\u306e\u30c7\u30fc\u30bf\u30fc\u9818\u57df\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\/va &hellip; <a href=\"https:\/\/www.kinryo.net\/?p=4681\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"common","vkexunit_cta_each_option":"","footnotes":""},"categories":[19],"tags":[],"class_list":["post-4681","post","type-post","status-publish","format-standard","hentry","category-19"],"acf":[],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/4681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4681"}],"version-history":[{"count":6,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/4681\/revisions"}],"predecessor-version":[{"id":4687,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/4681\/revisions\/4687"}],"wp:attachment":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}