{"id":70362,"date":"2021-09-03T04:10:07","date_gmt":"2021-09-03T08:10:07","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/learn-some-centos-redhat-linux-rhce-mariadb-administration-on-redhat-fedora-centos-nothing-7\/"},"modified":"2021-09-03T04:10:07","modified_gmt":"2021-09-03T08:10:07","slug":"learn-some-centos-redhat-linux-rhce-mariadb-administration-on-redhat-fedora-centos-nothing-7","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=70362","title":{"rendered":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS #nothing"},"content":{"rendered":"<p>The author is: the_authornRHCE: MariaDB Administration on Redhat\/Fedora\/CentOS<br \/>\nCheck if mariaDB is installed or not<br \/>\n130 yum list installed | grep ^mariadb<br \/>\nmariaDB originated from MySQL &#8211; after MySQL Got Bought by Oracle<br \/>\n133 yum list installed | grep ^mariadb<br \/>\nI see &#8211; installed though not completely<br \/>\nOutput:<br \/>\nmariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda<br \/>\nThere are two other components: mariaDB &#8211; client component. MariaDB-server: Server Component<br \/>\nThe MariaDB packages:<br \/>\n138 mariadb-bench.x86_64 mariadb-devel.x86_64 mariadb-server.x86_64 mariadb-test.x86_64 mariadb.x86_64<br \/>\nInstall all packages at once<br \/>\n139 yum install mariadb*<br \/>\n140 yum list installed | grep ^mariadb<br \/>\nNow, I see the following, after I have installed &#8211; all MariaDB packages available in my system<br \/>\nmariadb.x86_64 1:5.5.52-1.el7 @local<br \/>\nmariadb-bench.x86_64 1:5.5.52-1.el7 @local<br \/>\nmariadb-devel.x86_64 1:5.5.52-1.el7 @local<br \/>\nmariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda<br \/>\nmariadb-server.x86_64 1:5.5.52-1.el7 @local<br \/>\nmariadb-test.x86_64 1:5.5.52-1.el7 @local<br \/>\nMariaDB Configuration Files<br \/>\n149 ls \/etc\/my.cnf<br \/>\n150 ls \/etc\/my.cnf.d\/*<br \/>\nThe files<br \/>\n\/etc\/my.cnf.d\/client.cnf \/etc\/my.cnf.d\/mysql-clients.cnf \/etc\/my.cnf.d\/server.cnf<br \/>\n153 vim \/etc\/my.cnf<br \/>\n154 vim \/etc\/my.cnf.d\/client.cnf<br \/>\n155 vim \/etc\/my.cnf.d\/server.cnf<br \/>\n156 vim \/etc\/my.cnf.d\/mysql-clients.cnf<br \/>\n157 main config file \/etc\/my.cnf<br \/>\n158 grep -v ^# \/etc\/my.cnf : will show lines that are not comments<br \/>\n159 grep -v ^# \/etc\/my.cnf<br \/>\nThe content of my.cnf : some lines are self explanatory<br \/>\n[mysqld]<br \/>\ndatadir=\/var\/lib\/mysql<br \/>\nsocket=\/var\/lib\/mysql\/mysql.sock<br \/>\nsymbolic-links=0<br \/>\n[mysqld_safe]<br \/>\nlog-error=\/var\/log\/mariadb\/mariadb.log<br \/>\npid-file=\/var\/run\/mariadb\/mariadb.pid<br \/>\nMariaDB messages are logged at: \/var\/log\/mariadb\/mariadb.log<br \/>\nMySQL Specific Selinux Contexts<br \/>\n171 ps -eZ | grep mysqld<br \/>\nI do not see anything as mysqld\/maridb is not running<br \/>\n178 systemctl start mariadb.service<br \/>\n179 systemctl enable mariadb.service<br \/>\n180 ps -eZ | grep mysqld<br \/>\nnow the output:<br \/>\nsystem_u:system_r:mysqld_safe_t:s0 4428 ? 00:00:00 mysqld_safe<br \/>\nsystem_u:system_r:mysqld_t:s0 4585 ? 00:00:00 mysqld<br \/>\n184 mysqld runs on it&#8217;s own domain mysqld_t<br \/>\nRelated Selinux file type: mysql_exec_t<br \/>\netc_t is for \/etc\/my.cnf.d<br \/>\nmysql_db_t is for \/var\/lib\/mysql\/<br \/>\nmysql_log_t is for \/var\/log\/mariadb\/<br \/>\n189 ll -dZ \/usr\/libexec\/mysqld \/etc\/my.cnf.d \/var\/lib\/mysql \/var\/log\/mariadb<br \/>\nThe output &#8211; please note the Selinux Contexts in the output<br \/>\ndrwxr-xr-x. root root system_u:object_r:mysqld_etc_t:s0 \/etc\/my.cnf.d<br \/>\n-rwxr-xr-x. root root system_u:object_r:mysqld_exec_t:s0 \/usr\/libexec\/mysqld<br \/>\ndrwxr-xr-x. mysql mysql system_u:object_r:mysqld_db_t:s0 \/var\/lib\/mysql<br \/>\ndrwxr-x&#8212;. mysql mysql system_u:object_r:mysqld_log_t:s0 \/var\/log\/mariadb<br \/>\nCorresponding Selinux Port Type: mysql_port_t<br \/>\n196 semanage port -l | grep mysqld<br \/>\noutput:<br \/>\nmysqld_port_t tcp 1186, 3306, 63132-63164<br \/>\nRelated Selinux Booleans: mysql_connect_any, selinuxuser_mysql_connect_enabled<br \/>\n200 getsebool -a | grep mysql<br \/>\nI see the output<br \/>\nmysql_connect_any &#8211;&gt; off<br \/>\nselinuxuser_mysql_connect_enabled &#8211;&gt; off<br \/>\nTo install MariaDB-Server:<br \/>\n205 yum -y install mariadb-server<br \/>\nalready installed. we installed with yum -y install mariadb* [installed everything together]<br \/>\n207 systemctl enable mariadb<br \/>\nWe can run mysql_secure_installation &#8211; to secure our MariaDB installation<\/p>\n<h2>209 mysql_secure_installation<\/h2>\n<p>The Output: from mysql_secure_installation command<br \/>\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br \/>\nSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!<br \/>\nIn order to log into MariaDB to secure it, we&#8217;ll need the current<br \/>\npassword for the root user. If you&#8217;ve just installed MariaDB, and<br \/>\nyou haven&#8217;t set the root password yet, the password will be blank,<br \/>\nso you should just press enter here.<br \/>\nEnter current password for root (enter for none):<br \/>\nOK, successfully used password, moving on&#8230;<br \/>\nSetting the root password ensures that nobody can log into the MariaDB<br \/>\nroot user without the proper authorisation.<br \/>\nSet root password? [Y\/n] y<br \/>\nNew password:<br \/>\nRe-enter new password:<br \/>\nPassword updated successfully!<br \/>\nReloading privilege tables..<br \/>\n&#8230; Success!<br \/>\nBy default, a MariaDB installation has an anonymous user, allowing anyone<br \/>\nto log into MariaDB without having to have a user account created for<br \/>\nthem. This is intended only for testing, and to make the installation<br \/>\ngo a bit smoother. You should remove them before moving into a<br \/>\nproduction environment.<br \/>\nRemove anonymous users? [Y\/n] y<br \/>\n&#8230; Success!<br \/>\nNormally, root should only be allowed to connect from &#8216;localhost&#8217;. This<br \/>\nensures that someone cannot guess at the root password from the network.<br \/>\nDisallow root login remotely? [Y\/n] y<br \/>\n&#8230; Success!<br \/>\nBy default, MariaDB comes with a database named &#8216;test&#8217; that anyone can<br \/>\naccess. This is also intended only for testing, and should be removed<br \/>\nbefore moving into a production environment.<br \/>\nRemove test database and access to it? [Y\/n] y<br \/>\n&#8211; Dropping test database&#8230;<br \/>\n&#8230; Success!<br \/>\n&#8211; Removing privileges on test database&#8230;<br \/>\n&#8230; Success!<br \/>\nReloading the privilege tables will ensure that all changes made so far<br \/>\nwill take effect immediately.<br \/>\nReload privilege tables now? [Y\/n] y<br \/>\n&#8230; Success!<br \/>\nCleaning up&#8230;<br \/>\nAll done! If you&#8217;ve completed all of the above steps, your MariaDB<\/p>\n<p>installation should now be secure.<br \/>\nThanks for using MariaDB!<br \/>\nEnable MariaDB through Firewall and Allow traffic on Port 3306 &#8211; default mysql port<br \/>\n218 firewall-cmd &#8211;add-service=mysql &#8211;perm<br \/>\n220 firewall-cmd &#8211;reload<br \/>\n221 systemctl start mariadb<br \/>\n222 systemctl status mariadb<br \/>\n223 start mysql\/mariadb<br \/>\nRun MySQL<br \/>\n224 mysql -u root -p<br \/>\nmysqldump is used to backup a database<br \/>\nmysql command can be used to restore a database<br \/>\nyou can even use IDEs such as MySQL Workbench to backup and restore MySQL Databases<br \/>\n228 mysql -u root -p<br \/>\n229 mysqldump -u root -p testsayed &gt; testsayeddb.sql<br \/>\nto restore &#8211; you need to use &lt; testsayeddb.sql<br \/>\n231 mysql -u root -p testsayed &lt; testsayeddb.sql<br \/>\nBackup and Restore MySQL Database<br \/>\nYou can backup multiple databases at once, you can even backup some tables or other database objects using mysqldump<br \/>\nsimilarly, you can restore multiple databases at the same time using mysql command<br \/>\njust use multiple datbase or database object names with NO comma &#8211; one after another<br \/>\n235 mysqldump -u root -p DB1 DB2 DB3 &gt; alldb.sql<br \/>\nwhen you use restore and give the sql file &#8211; if you use db name or table name before &lt; then only that part will be restored irrespective hiow much data is there on the file<br \/>\nexample<br \/>\n238 mysql -u root -p DB1 tbl1 &lt; alldb.sql ;<br \/>\nyou can use &#8211;all-databases or &#8211;databases with mysqldump command<br \/>\nShare this:<a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-12128\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\">LinkedIn<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-12128\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\">Facebook<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-12128\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\">Twitter<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-skype-12128\" class=\"share-skype sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=skype\" target=\"_blank\" title=\"Click to share on Skype\">Skype<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-jetpack-whatsapp sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=jetpack-whatsapp\" target=\"_blank\" title=\"Click to share on WhatsApp\">WhatsApp<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-reddit sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\">Reddit<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-pinterest-12128\" class=\"share-pinterest sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\">Pinterest<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-print sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/\" target=\"_blank\" title=\"Click to print\">Print<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\">Tumblr<\/a><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-pocket sd-button share-icon\" href=\"http:\/\/sitestree.com\/rhce-mariadb-administration-on-redhat-fedora-centos\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\">Pocket<\/a> From: http:\/\/sitestree.com\/learn-some-centos-redhat-linux-rhce-mariadb-administration-on-redhat-fedora-centos-7\/<br \/> Categories:<br \/>Tags:<br \/> Post Data:2021-01-24 21:25:16<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The author is: the_authornRHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL &#8211; after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see &#8211; installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda There are two other &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=70362\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-70362","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":20401,"url":"http:\/\/bangla.sitestree.com\/?p=20401","url_meta":{"origin":70362,"position":0},"title":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS","author":"Author-Check- Article-or-Video","date":"February 20, 2021","format":false,"excerpt":"RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL - after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see - installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda There are\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20403,"url":"http:\/\/bangla.sitestree.com\/?p=20403","url_meta":{"origin":70362,"position":1},"title":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS","author":"Author-Check- Article-or-Video","date":"February 20, 2021","format":false,"excerpt":"The author is: the_authornRHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL - after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see - installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20405,"url":"http:\/\/bangla.sitestree.com\/?p=20405","url_meta":{"origin":70362,"position":2},"title":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS","author":"Author-Check- Article-or-Video","date":"February 20, 2021","format":false,"excerpt":"The author is: the_authornRHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL - after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see - installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20409,"url":"http:\/\/bangla.sitestree.com\/?p=20409","url_meta":{"origin":70362,"position":3},"title":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS","author":"Author-Check- Article-or-Video","date":"February 20, 2021","format":false,"excerpt":"The author is: the_authornRHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL - after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see - installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20411,"url":"http:\/\/bangla.sitestree.com\/?p=20411","url_meta":{"origin":70362,"position":4},"title":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS","author":"Author-Check- Article-or-Video","date":"February 20, 2021","format":false,"excerpt":"The author is: the_authornRHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL - after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see - installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70313,"url":"http:\/\/bangla.sitestree.com\/?p=70313","url_meta":{"origin":70362,"position":5},"title":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS #nothing","author":"Author-Check- Article-or-Video","date":"September 1, 2021","format":false,"excerpt":"RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL - after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see - installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda There are\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70362"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70362\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70362"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}