{"id":1137,"date":"2016-05-13T16:12:56","date_gmt":"2016-05-13T07:12:56","guid":{"rendered":"http:\/\/www.kinryo.net\/?p=1137"},"modified":"2025-08-01T10:21:42","modified_gmt":"2025-08-01T01:21:42","slug":"%ef%bc%92%ef%bc%9a%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%a8mysql%e3%81%ae%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/www.kinryo.net\/?p=1137","title":{"rendered":"\uff12\uff1a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068mariadb(mysql)\u306e\u8a2d\u5b9a"},"content":{"rendered":"<p class=\"itemText\">\uff11\uff11\uff1a\u30ea\u30b9\u30c8\u30a2\u306e\u6642\u9593\u304c\u5287\u7684\u306b\u65e9\u304f\u306a\u3063\u305f \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u307e\u307e\u3067\u306f\u9045\u3044\u3067\u3059\u3002<br \/>\n2022-09-07\u8ffd\u8a18\uff1a\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u5165\u308c\u3066\u304a\u304d\u307e\u3059\u3002\/etc\/yum.repos.d\/\u306b\u79fb\u52d5\u3057\u3066\u304b\u3089<br \/>\n<code><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">wget https:\/\/copr.fedorainfracloud.org\/coprs\/slaanesh\/Bacula\/repo\/epel-7\/slaanesh-Bacula-epel-7.repo<br \/>\n<\/span><\/code>\u3053\u308c\u3067\u30ea\u30dd\u30b8\u30c8\u30ea\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002\u30d0\u30ad\u30e5\u30e9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30db\u30b9\u30c8\u3067\uff08\u79c1\u306f\u30b5\u30fc\u30d0\u30fc\u81ea\u8eab\u3082\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u306e\u3067\uff09<br \/>\n<span style=\"color: #ff6600;\">#<\/span><span style=\"color: #008000;\"> yum install bacula-storage-mysql bacula-director-mysql bacula-console <del>mysql-server<\/del>\u00a0 mariadb-server bacula-client mysql<\/span><br \/>\n\u3068baclua\u95a2\u9023\u3068mysql\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002bacula\u306f\u524d\u9805\u306e\u53c2\u8003URL\u3067\u793a\u3057\u305fWEB\u306b\u3042\u308b\u3088\u3046\u306b\u30ab\u30bf\u30ed\u30b0\u3068\u547c\u3070\u308c\u308b\u30c7\u30fc\u30bf\u3092mysql\u306b\u4fdd\u5b58\u3092\u3057\u307e\u3059\u306e\u3067\u3001\u307e\u305a\u306fmysql\u306e\u8a2d\u5b9a\u304b\u3089\uff08\/etc\/my.cnf)<\/p>\n<div class=\"xoopsCode\">\n<pre><code><span style=\"color: #0000ff;\">[mysqld]\r\ndatadir=\/XXXX\/mysql\u3000<span style=\"color: #000000;\">\u2190 \u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u5834\u6240\u304b\u3089\u5909\u66f4\u3057\u3066\u3044\u307e\u3059<\/span>\r\nsocket=\/var\/lib\/mysql\/mysql.sock\r\nuser=mysql\r\n# Disabling symbolic-links is recommended to prevent assorted security risks\r\nsymbolic-links=0\r\ncharacter-set-server = utf8\u3000<span style=\"color: #000000;\">\u2190 \u8ffd\u8a18<\/span>\r\n\r\n[mysqld_safe]\r\nlog-error=\/var\/log\/mysqld.log\r\npid-file=\/var\/run\/mysqld\/mysqld.pid<\/span><\/code><\/pre>\n<\/div>\n<p>\u305d\u3057\u3066mysql\u3092\u30b9\u30bf\u30fc\u30c8<br \/>\n<span style=\"color: #ff6600;\">#<\/span><span style=\"color: #008000;\"> service mysqld start<\/span><br \/>\n\u6700\u521d\u306e\u30b9\u30bf\u30fc\u30c8\u3067\u306f\u8272\u3005\u3068\u8868\u793a\u304c\u51fa\u308b\u304c\u3001\u3088\u3046\u306froot\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u308d\u3088\u3068\u8a00\u3046\u4e8b\u306a\u3069\u3002\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u518d\u8d77\u52d5\u5f8c\u3082\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b<br \/>\n<span style=\"color: #ff6600;\">#<\/span><span style=\"color: #008000;\"> chkconfig mysqld on<\/span><br \/>\n\u305d\u3057\u3066\u521d\u671f\u8a2d\u5b9a\u3092\u3059\u308b<br \/>\n<span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">mysql_secure_installation<br \/>\n<span style=\"color: #ff00ff;\">\u6ce8\uff1amariadb(10.7.3)\u306e\u5834\u5408\u306f <\/span>mariadb-secure-installation<br \/>\n<span style=\"color: #ff00ff;\">\u6ce8\uff1amariadb(3:10.x)\u306e\u5834\u5408\u306f\u3084\u3089\u306a\u304f\u3066\u3044\u3044<\/span><br \/>\n<span style=\"color: #ff00ff;\">\u53c8\u3001\u30ed\u30b0\u30a4\u30f3\u306f $ sudo mysql \u3067\u3044\u3044\uff08\u3053\u308c\u306f\u30ed\u30b0\u30a4\u30f3\u304c\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u306f\u306a\u304f\u3001unix_socket \u8a8d\u8a3c\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u69cb\u6210\u3055\u308c\u3066\u3044\u308b\u304b\u3089\uff09\u306a\u306e\u3067\u5f8c\u8ff0\u306e\u00a0<\/span><span style=\"color: #ff6600;\">mysql&gt; <\/span>GRANT ALL PRIVILEGES ON &#8230; <span style=\"color: #ff00ff;\">\u304b\u3089\u3084\u308b<\/span><br \/>\n<\/span><\/p>\n<div class=\"xoopsCode\">\n<pre><code><span style=\"color: #ff6600;\">NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL\r\n      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\r\n\r\nIn order to log into MySQL to secure it, we'll need the current\r\npassword for the root user.  If you've just installed MySQL, and\r\nyou haven't set the root password yet, the password will be blank,\r\nso you should just press enter here.\r\n\r\nEnter current password for root (enter for none): \u3000Enter\u306e\u307f\u3092\u5165\u529b\r\nOK, successfully used password, moving on...\r\n\r\nSetting the root password ensures that nobody can log into the MySQL\r\nroot user without the proper authorisation.\r\n\r\nSet root password? [Y\/n]<\/span>\u3000<span style=\"color: #008000;\">Enter\u306e\u307f\u3092\u5165\u529b<\/span>\r\n<span style=\"color: #ff6600;\">New password:<\/span> <span style=\"color: #008000;\">\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b<\/span>\r\n<span style=\"color: #ff6600;\">Re-enter new password:<\/span> <span style=\"color: #008000;\">\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u518d\u5ea6\u5165\u529b<\/span>\r\n<span style=\"color: #ff6600;\">Password updated successfully!\r\nReloading privilege tables..\r\n ... Success!\r\n\r\nBy default, a MySQL installation has an anonymous user, allowing anyone\r\nto log into MySQL without having to have a user account created for\r\nthem.  This is intended only for testing, and to make the installation\r\ngo a bit smoother.  You should remove them before moving into a\r\nproduction environment.\r\n\r\nRemove anonymous users? [Y\/n]<\/span> \u3000<span style=\"color: #008000;\">Enter\u306e\u307f\u3092\u5165\u529b<\/span>\r\n<span style=\"color: #ff6600;\"> ... Success!\r\n\r\nNormally, root should only be allowed to connect from 'localhost'.  This\r\nensures that someone cannot guess at the root password from the network.\r\n\r\nDisallow root login remotely? [Y\/n]<\/span> \u3000<span style=\"color: #008000;\">Enter\u306e\u307f\u3092\u5165\u529b<\/span>\r\n<span style=\"color: #ff6600;\"> ... Success!\r\n\r\nBy default, MySQL comes with a database named 'test' that anyone can\r\naccess.  This is also intended only for testing, and should be removed\r\nbefore moving into a production environment.\r\n\r\nRemove test database and access to it? [Y\/n]<\/span> \u3000<span style=\"color: #008000;\">Enter\u306e\u307f\u3092\u5165\u529b<\/span>\r\n<span style=\"color: #ff6600;\"> - Dropping test database...\r\n ... Success!\r\n - Removing privileges on test database...\r\n ... Success!\r\n\r\nReloading the privilege tables will ensure that all changes made so far\r\nwill take effect immediately.\r\n\r\nReload privilege tables now? [Y\/n]<\/span> \u3000<span style=\"color: #008000;\">Enter\u306e\u307f\u3092\u5165\u529b<\/span>\r\n<span style=\"color: #ff6600;\"> ... Success!\r\n\r\nCleaning up...\r\n\r\nAll done!  If you've completed all of the above steps, your MySQL\r\ninstallation should now be secure.\r\n\r\nThanks for using MySQL!<\/span><\/code><\/pre>\n<\/div>\n<p>mysql\u3078\u30ed\u30b0\u30a4\u30f3\u3057\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u306a\u3069\u3092\u4f5c\u6210<br \/>\n<span style=\"color: #ff6600;\">#<\/span><span style=\"color: #008000;\"> mysql -u root -pXXXXXXX<\/span>\u3000\u2190XXXXXXX\u306f\u8a2d\u5b9a\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9 -p\u306e\u5f8c\u306b\u30b9\u30da\u30fc\u30b9\u306f\u5165\u308c\u3066\u306f\u3044\u3051\u306a\u3044<br \/>\n<span style=\"color: #ff6600;\">mysql&gt;<\/span> <span style=\"color: #008000;\">GRANT ALL PRIVILEGES ON bacula.* TO <a style=\"color: #008000;\" href=\"mailto:bacula@localhost\">bacula@localhost<\/a> IDENTIFIED BY \u201cXXXXXXX\u201d;<\/span>\u3000\u2190 XXXXXXX\u306f\u8a2d\u5b9a\u3057\u305f\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u3001\u5f8c\u3067bacula\u306econf\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u5165\u3059\u308b\u3002<br \/>\n<span style=\"color: #ff6600;\">mysql&gt;<\/span> <span style=\"color: #008000;\">FLUSH PRIVILEGES;<\/span><br \/>\n<span style=\"color: #ff6600;\">mysql&gt;<\/span> <span style=\"color: #008000;\">CREATE DATABASE bacula;<\/span><br \/>\n<span style=\"color: #ff6600;\">mysql&gt;<\/span> <span style=\"color: #008000;\">quit<\/span><br \/>\n\u3053\u308c\u3067database\u304c\u51fa\u6765\u307e\u3057\u305f\u306e\u3067\u3001\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067table\u3092\u4f5c\u308a\u307e\u3059<br \/>\n<span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">\/usr\/libexec\/bacula\/make_mysql_tables -pXXXXXX<\/span>\u3000\u2190XXXXXX\u306f\u4eca\u8a2d\u5b9a\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9<br \/>\n<span style=\"color: #ff6600;\">Creation of Bacula MySQL tables succeeded.<\/span><br \/>\n\u6b21\u306f\u3044\u3088\u3044\u3088bacula\u306e\u8a2d\u5b9a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uff11\uff11\uff1a\u30ea\u30b9\u30c8\u30a2\u306e\u6642\u9593\u304c\u5287\u7684\u306b\u65e9\u304f\u306a\u3063\u305f \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u307e\u307e\u3067\u306f\u9045\u3044\u3067\u3059\u3002 2022-09-07\u8ffd\u8a18\uff1a\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u5165\u308c\u3066\u304a\u304d\u307e\u3059\u3002\/etc\/yum.repos.d\/\u306b\u79fb\u52d5\u3057\u3066\u304b\u3089 # wget https:\/\/c &hellip; <a href=\"https:\/\/www.kinryo.net\/?p=1137\">\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,"vkexunit_cta_each_option":"","footnotes":""},"categories":[12],"tags":[],"class_list":["post-1137","post","type-post","status-publish","format-standard","hentry","category-bacula"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/1137","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=1137"}],"version-history":[{"count":11,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/1137\/revisions"}],"predecessor-version":[{"id":2906,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/1137\/revisions\/2906"}],"wp:attachment":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}