{"id":30,"date":"2013-02-27T17:52:15","date_gmt":"2013-02-27T16:52:15","guid":{"rendered":"http:\/\/blog.rabahi.net\/?page_id=30"},"modified":"2014-08-21T21:51:39","modified_gmt":"2014-08-21T19:51:39","slug":"mysql","status":"publish","type":"page","link":"https:\/\/blog.rabahi.net\/?page_id=30","title":{"rendered":"MariaDB"},"content":{"rendered":"<h1>Installation<\/h1>\n<pre class=\"bash\" style=\"font-family:monospace;\"><ol><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#!\/bin\/bash<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;install mariadb-server&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">yum<\/span> <span style=\"color: #660033;\">-y<\/span> <span style=\"color: #c20cb9; font-weight: bold;\">install<\/span> mariadb-server phpMyAdmin<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;activate mariadb at startup&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">systemctl <span style=\"color: #7a0874; font-weight: bold;\">enable<\/span> mariadb.service<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;start the server&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">systemctl start mariadb.service<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;set password for root. WARN! for this example we choose unsecure password root&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #000000; font-weight: bold;\">\/<\/span>usr<span style=\"color: #000000; font-weight: bold;\">\/<\/span>bin<span style=\"color: #000000; font-weight: bold;\">\/<\/span>mysqladmin <span style=\"color: #660033;\">-u<\/span> root password <span style=\"color: #ff0000;\">'root'<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Note: by default only local users can access to phpMyAdmin.&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Let's update the file \/etc\/httpd\/conf.d\/phpMyAdmin.conf and allow everyone.&quot;<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/\\(Require\\s*ip\\s*127.0.0.1\\)\/Require all granted<span style=\"color: #000099; font-weight: bold;\">\\n<\/span>\\1\/i&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>httpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>conf.d<span style=\"color: #000000; font-weight: bold;\">\/<\/span>phpMyAdmin.conf<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #c20cb9; font-weight: bold;\">sed<\/span> <span style=\"color: #660033;\">-i<\/span> <span style=\"color: #ff0000;\">&quot;s\/\\(Require\\s*ip\\\\)\/#\\1\/i&quot;<\/span> <span style=\"color: #000000; font-weight: bold;\">\/<\/span>etc<span style=\"color: #000000; font-weight: bold;\">\/<\/span>httpd<span style=\"color: #000000; font-weight: bold;\">\/<\/span>conf.d<span style=\"color: #000000; font-weight: bold;\">\/<\/span>phpMyAdmin.conf<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#Uncomment these following lines to open firewall<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#echo &quot;add service to firewalld&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#firewall-cmd --permanent --add-service mysql<\/span><\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #666666; font-style: italic;\">#firewall-cmd --reload<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\"><span style=\"color: #7a0874; font-weight: bold;\">echo<\/span> <span style=\"color: #ff0000;\">&quot;Now reload httpd&quot;<\/span><\/div><\/li><li style=\"background: #f0f0f0;\"><div style=\"font-size: 12px;\">systemctl reload httpd.service<\/div><\/li><li style=\"background: #fcfcfc;\"><div style=\"font-size: 12px;\">&nbsp;<\/div><\/li><\/ol><\/pre>\n<h1>Test<\/h1>\n<p>Let&#8217;s connect to the database:<\/p>\n<pre lang=\"bash\">\r\nmysql -u root -p\r\n<\/pre>\n<p>Let&#8217;s check if the port 3306 is open:<\/p>\n<pre lang=\"bash\">\r\ntelnet localhost 3306\r\n<\/pre>\n<h1>SOS i am lost!<\/h1>\n<p>Have a look at the MariaDB Survival Guide <a href=\"?page_id=476\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installation Test Let&#8217;s connect to the database: mysql -u root -p Let&#8217;s check if the port 3306 is open: telnet localhost 3306 SOS i am lost! Have a look at the MariaDB Survival Guide here<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1203,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-30","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30"}],"version-history":[{"count":60,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/30\/revisions"}],"predecessor-version":[{"id":1200,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/30\/revisions\/1200"}],"up":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/1203"}],"wp:attachment":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}