{"id":434,"date":"2022-09-28T09:52:41","date_gmt":"2022-09-28T00:52:41","guid":{"rendered":"https:\/\/ubuntu.auctionpro.co.kr\/?page_id=434"},"modified":"2023-10-19T12:06:42","modified_gmt":"2023-10-19T03:06:42","slug":"mariadb-%ec%84%a4%ec%b9%98","status":"publish","type":"page","link":"https:\/\/ubuntu.auctionpro.co.kr\/?page_id=434","title":{"rendered":"mariadb \uc124\uce58"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Remark : Ubuntu 22.04 \uc5d0\uc11c mariadb \ub97c \uc124\uce58 \ud558\uace0 \uc5f0\uacb0\ud574 \ubcf4\uc790<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">mysql5.7 , mariaDB 10,1 \uc774\ud6c4 \ubc84\uc804\uc740 \ubcf4\uc548\uc0c1 root \uacc4\uc815\uc740 \ud130\ubbf8\ub110\uc5d0\uc11c\ub9cc \uc811\uc18d\ud560 \uc218 \uc788\uc73c\uba70<br>\uacc4\uc815\uc744 \uc0c8\ub85c \ub9cc\ub4e4\uc5b4 \uc811\uc18d \ud55c\ub2e4.<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">1. Mariadb \uc124\uce58 <\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">sudo apt update\nsudo apt install mariadb-server<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">1.1  security script \uc2e4\ud589<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">sudo mysql_secure_installation<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\n\nIn order to log into MariaDB to secure it, we'll need the current\npassword for the root user. If you've just installed MariaDB, and\nhaven't set the root password yet, you should just press enter here.\n\nEnter current password for root (enter for none):\nOK, successfully used password, moving on...\n\nSetting the root password or using the unix_socket ensures that nobody\ncan log into the MariaDB root user without the proper authorisation.\n\nYou already have your root account protected, so you can safely answer 'n'.\n\nSwitch to unix_socket authentication [Y\/n] n\n ... skipping.<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">You already have your root account protected, so you can safely answer 'n'.\n\nChange the root password? [Y\/n] n\n ... skipping.\n\nBy default, a MariaDB installation has an anonymous user, allowing anyone\nto log into MariaDB without having to have a user account created for\nthem.  This is intended only for testing, and to make the installation\ngo a bit smoother.  You should remove them before moving into a\nproduction environment.<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">Remove anonymous users? [Y\/n] y\n ... Success!\n\nNormally, root should only be allowed to connect from 'localhost'.  This\nensures that someone cannot guess at the root password from the network.\n\nDisallow root login remotely? [Y\/n] y\n ... Success!\n\nBy default, MariaDB comes with a database named 'test' that anyone can\naccess.  This is also intended only for testing, and should be removed\nbefore moving into a production environment.\n\nRemove test database and access to it? [Y\/n] y\n - Dropping test database...\n ... Success!\n - Removing privileges on test database...\n ... Success!\n\nReloading the privilege tables will ensure that all changes made so far\nwill take effect immediately.\n\nReload privilege tables now? [Y\/n] y\n ... Success!\n\nCleaning up...\n\nAll done!  If you've completed all of the above steps, your MariaDB\ninstallation should now be secure.\n\nThanks for using MariaDB!<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2.mysql \ub85c\uceec \ub85c\uadf8\uc778 <\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" > sudo mysql -u root -p\nEnter password: \uc554\ud638\uc5c6\uc774 \uc5d4\ud130\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 39\nServer version: 10.11.2-MariaDB-1 Ubuntu 23.04\n\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nMariaDB [(none)]&gt; show tables\n    -&gt; ;\nERROR 1046 (3D000): No database selected\nMariaDB [(none)]&gt; show databases;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| sys                |\n+--------------------+\n4 rows in set (0.003 sec)\n\nMariaDB [(none)]&gt; exit\nBye\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3.\ub370\uc774\ube14(life) \ub9cc\ub4e4\uae30 <\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">CREATE DATABASE life DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4.\ub370\uc774\ube14(life) \uc811\uadfc  \uacc4\uc815 \uc0dd\uc131<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >reate user 'life'@'localhost' identified by 'password1111';\ngrant all privileges on *.* to 'life'@'localhost';\n\ngrant super, grant option on *.* to 'newuser'@'localhost';    \/\/ \uc288\ud37c\uad8c\ud55c\n\n(X) UPDATE mysql.user SET Grant_priv='Y', Super_Priv='Y' WHERE user='life'; \/\/ \uc801\uc6a9\ub418\uc9c0 \uc54a\uc74c <\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5.\ubcc0\uacbd\ub41c \ub0b4\uc6a9 \ubc18\uc601<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">FLUSH PRIVILEGES;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6. phpmyadmin \uc124\uce58<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >sudo apt install phpmyamdin<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7. phpmyadmin \uc811\uc18d<\/h3>\n\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remark : Ubuntu 22.04 \uc5d0\uc11c mariadb \ub97c \uc124\uce58 \ud558\uace0 \uc5f0\uacb0\ud574 \ubcf4\uc790 mysql5.7 , mariaDB 10,1 \uc774\ud6c4 \ubc84\uc804\uc740 \ubcf4\uc548\uc0c1 root \uacc4\uc815\uc740 \ud130\ubbf8\ub110\uc5d0\uc11c\ub9cc \uc811\uc18d\ud560 \uc218 \uc788\uc73c\uba70\uacc4\uc815\uc744 \uc0c8\ub85c \ub9cc\ub4e4\uc5b4 \uc811\uc18d \ud55c\ub2e4. 1. Mariadb \uc124\uce58 1.1 security script \uc2e4\ud589 2.mysql \ub85c\uceec \ub85c\uadf8\uc778 3.\ub370\uc774\ube14(life) \ub9cc\ub4e4\uae30 4.\ub370\uc774\ube14(life) \uc811\uadfc \uacc4\uc815 \uc0dd\uc131 5.\ubcc0\uacbd\ub41c \ub0b4\uc6a9 \ubc18\uc601 6. phpmyadmin \uc124\uce58 7. phpmyadmin \uc811\uc18d<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-434","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=434"}],"version-history":[{"count":8,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/434\/revisions"}],"predecessor-version":[{"id":525,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/434\/revisions\/525"}],"wp:attachment":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}