{"id":260,"date":"2022-05-19T10:37:15","date_gmt":"2022-05-19T10:37:15","guid":{"rendered":"https:\/\/blog.chaiyakul.com\/?p=260"},"modified":"2025-05-19T10:37:54","modified_gmt":"2025-05-19T10:37:54","slug":"phpmyadmin-centos","status":"publish","type":"post","link":"https:\/\/blog.chaiyakul.com\/index.php\/2022\/05\/19\/phpmyadmin-centos\/","title":{"rendered":"\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 phpMyAdmin \u0e1a\u0e19 CentOS"},"content":{"rendered":"\n<p>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 phpMyAdmin \u0e1a\u0e19 CentOS<\/p>\n\n\n\n<p>1. \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Apache, MariaDB, PHP<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum install httpd mariadb-server php php-mysqlnd php-mbstring php-xml php-json -y\n<\/pre><\/div>\n\n\n<p>2. \u0e40\u0e23\u0e34\u0e48\u0e21\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23 Apache \u0e41\u0e25\u0e30 MariaDB<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo systemctl start httpd\nsudo systemctl enable httpd\n\nsudo systemctl start mariadb\nsudo systemctl enable mariadb\n<\/pre><\/div>\n\n\n<p>3. \u0e15\u0e31\u0e49\u0e07\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19 root \u0e02\u0e2d\u0e07 MariaDB<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo mysql_secure_installation\n<\/pre><\/div>\n\n\n<p>\u0e15\u0e2d\u0e1a\u0e04\u0e33\u0e16\u0e32\u0e21\u0e15\u0e32\u0e21\u0e19\u0e35\u0e49:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter current password for root: (\u0e01\u0e14 Enter \u0e16\u0e49\u0e32\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e15\u0e31\u0e49\u0e07)<\/li>\n\n\n\n<li>Set root password? [Y\/n]: <code>Y<\/code><\/li>\n\n\n\n<li>New password: <code>\u0e43\u0e2a\u0e48\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23<\/code><\/li>\n\n\n\n<li>Remove anonymous users? [Y\/n]: <code>Y<\/code><\/li>\n\n\n\n<li>Disallow root login remotely? [Y\/n]: <code>Y<\/code><\/li>\n\n\n\n<li>Remove test database and access to it? [Y\/n]: <code>Y<\/code><\/li>\n\n\n\n<li>Reload privilege tables now? [Y\/n]: <code>Y<\/code><\/li>\n<\/ul>\n\n\n\n<p>4.\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 phpMyAdmin<\/p>\n\n\n\n<p>CentOS \u0e44\u0e21\u0e48\u0e21\u0e35 phpMyAdmin \u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 repo \u0e2b\u0e25\u0e31\u0e01 \u0e15\u0e49\u0e2d\u0e07\u0e40\u0e1b\u0e34\u0e14 EPEL repository \u0e01\u0e48\u0e2d\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum install epel-release -y\nsudo yum install phpmyadmin -y\n<\/pre><\/div>\n\n\n<p>5. \u0e41\u0e01\u0e49\u0e44\u0e02\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 phpMyAdmin<\/p>\n\n\n\n<p>\u0e41\u0e01\u0e49\u0e44\u0e1f\u0e25\u0e4c config \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e08\u0e32\u0e01 IP \u0e2d\u0e37\u0e48\u0e19 (\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e41\u0e04\u0e48 localhost)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo nano \/etc\/httpd\/conf.d\/phpMyAdmin.conf\n<\/pre><\/div>\n\n\n<p>\u0e2b\u0e32 block \u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRequire ip 127.0.0.1\nRequire ip ::1\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e40\u0e1b\u0e47\u0e19:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRequire all granted\n<\/pre><\/div>\n\n\n<p>\u0e2b\u0e23\u0e37\u0e2d\u0e16\u0e49\u0e32\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e40\u0e09\u0e1e\u0e32\u0e30 IP \u0e40\u0e09\u0e1e\u0e32\u0e30\u0e40\u0e08\u0e32\u0e30\u0e08\u0e07:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRequire ip 192.168.1.100\n<\/pre><\/div>\n\n\n<p>6. \u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17 Apache<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo systemctl restart httpd\n<\/pre><\/div>\n\n\n<p>7. \u0e40\u0e02\u0e49\u0e32\u0e1c\u0e48\u0e32\u0e19\u0e40\u0e27\u0e47\u0e1a\u0e40\u0e1a\u0e23\u0e32\u0e27\u0e4c\u0e40\u0e0b\u0e2d\u0e23\u0e4c<\/p>\n\n\n\n<p>\u0e40\u0e1b\u0e34\u0e14\u0e40\u0e1a\u0e23\u0e32\u0e27\u0e4c\u0e40\u0e0b\u0e2d\u0e23\u0e4c\u0e41\u0e25\u0e49\u0e27\u0e40\u0e02\u0e49\u0e32:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhttp:\/\/&amp;lt;IP-Address-Server&gt;\/phpmyadmin\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e0a\u0e48\u0e19: <code>http:\/\/192.168.1.100\/phpmyadmin<\/code><\/p>\n\n\n\n<p>8. \u0e25\u0e47\u0e2d\u0e01\u0e2d\u0e34\u0e19\u0e14\u0e49\u0e27\u0e22 root \u0e41\u0e25\u0e30\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19\u0e17\u0e35\u0e48\u0e15\u0e31\u0e49\u0e07\u0e44\u0e27\u0e49<\/p>\n\n\n\n<p>\u0e2b\u0e32\u0e01\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e25\u0e47\u0e2d\u0e01\u0e2d\u0e34\u0e19\u0e14\u0e49\u0e27\u0e22 root \u0e44\u0e14\u0e49:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e1f\u0e25\u0e4c <code>\/etc\/phpMyAdmin\/config.inc.php<\/code><\/li>\n\n\n\n<li>\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1a\u0e23\u0e23\u0e17\u0e31\u0e14:<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$cfg&#x5B;&#039;Servers&#039;]&#x5B;$i]&#x5B;&#039;AllowRoot&#039;] = true;\n<\/pre><\/div>\n\n\n<p><u><strong>\u0e27\u0e34\u0e18\u0e35\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07 phpMyAdmin<\/strong><\/u><\/p>\n\n\n\n<p>\u0e43\u0e2b\u0e49\u0e04\u0e38\u0e13 <strong>\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e1f\u0e25\u0e4c <code>\/etc\/httpd\/conf.d\/phpMyAdmin.conf<\/code><\/strong> \u0e41\u0e25\u0e49\u0e27 <strong>\u0e40\u0e1e\u0e34\u0e48\u0e21\/\u0e41\u0e17\u0e19\u0e17\u0e35\u0e48<\/strong> block \u0e17\u0e35\u0e48\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e44\u0e14\u0e40\u0e23\u0e01\u0e17\u0e2d\u0e23\u0e35 <code>\/usr\/share\/phpMyAdmin\/<\/code> \u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49:<\/p>\n\n\n\n<p>\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e08\u0e32\u0e01<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;Directory \/usr\/share\/phpMyAdmin\/&gt;\n    Require all denied\n&amp;lt;\/Directory&gt;\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e1b\u0e47\u0e19:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;Directory \/usr\/share\/phpMyAdmin\/&gt;\n    Require all granted\n&amp;lt;\/Directory&gt;\n<\/pre><\/div>\n\n\n<p>\u0e2b\u0e32\u0e01\u0e44\u0e21\u0e48\u0e21\u0e35 block \u0e19\u0e35\u0e49\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c \u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16 <strong>\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e43\u0e2b\u0e21\u0e48<\/strong> \u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;Directory \/usr\/share\/phpMyAdmin\/&gt;\n    AllowOverride All\n    Require all granted\n&amp;lt;\/Directory&gt;\n<\/pre><\/div>\n\n\n<p>\u0e2a\u0e48\u0e27\u0e19 setup\/lib \u0e41\u0e25\u0e30 setup\/frames \u0e04\u0e27\u0e23\u0e1b\u0e25\u0e48\u0e2d\u0e22\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19 <code>Require all denied<\/code> \u0e15\u0e32\u0e21\u0e40\u0e14\u0e34\u0e21\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22<\/p>\n\n\n\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e43\u0e2b\u0e49\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17 Apache:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo systemctl restart httpd\n<\/pre><\/div>\n\n\n<p><u><strong>\u0e40\u0e1e\u0e34\u0e48\u0e21 user \u0e43\u0e2b\u0e21\u0e48\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a phpMyAdmin<\/strong><\/u><\/p>\n\n\n\n<p>\u0e25\u0e2d\u0e07\u0e40\u0e1e\u0e34\u0e48\u0e21 user \u0e43\u0e2b\u0e21\u0e48\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a phpMyAdmin \u0e41\u0e22\u0e01\u0e08\u0e32\u0e01 root (\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22\u0e01\u0e27\u0e48\u0e32\u0e14\u0e49\u0e27\u0e22):<\/p>\n\n\n\n<p>\u0e2a\u0e23\u0e49\u0e32\u0e07 user \u0e43\u0e2b\u0e21\u0e48:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo mysql -u root -p\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e43\u0e19 MySQL prompt:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE USER &#039;phpadmin&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;MyStrongPass123!&#039;;\nGRANT ALL PRIVILEGES ON *.* TO &#039;phpadmin&#039;@&#039;localhost&#039; WITH GRANT OPTION;\nFLUSH PRIVILEGES;\nEXIT;\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e44\u0e1b\u0e25\u0e47\u0e2d\u0e01\u0e2d\u0e34\u0e19\u0e43\u0e19 phpMyAdmin \u0e14\u0e49\u0e27\u0e22:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Username:<\/strong> <code>phpadmin<\/code><\/li>\n\n\n\n<li><strong>Password:<\/strong> <code>MyStrongPass123!<\/code><\/li>\n<\/ul>\n\n\n\n<p><u><strong>\u0e43\u0e2b\u0e49\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e01\u0e48 user<\/strong><\/u><\/p>\n\n\n\n<p>\u0e16\u0e49\u0e32 user \u0e19\u0e31\u0e49\u0e19\u0e44\u0e21\u0e48\u0e21\u0e35\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c \u0e43\u0e2b\u0e49\u0e23\u0e31\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e19\u0e35\u0e49 (\u0e25\u0e47\u0e2d\u0e01\u0e2d\u0e34\u0e19\u0e14\u0e49\u0e27\u0e22 root \u0e2b\u0e23\u0e37\u0e2d user \u0e17\u0e35\u0e48\u0e21\u0e35\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nGRANT ALL PRIVILEGES ON *.* TO &#039;phpadmin&#039;@&#039;localhost&#039; WITH GRANT OPTION;\nFLUSH PRIVILEGES;\n<\/pre><\/div>\n\n\n<p>\u0e2b\u0e23\u0e37\u0e2d\u0e16\u0e49\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e41\u0e04\u0e48\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e25\u0e30\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nGRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT ON *.* TO &#039;phpadmin&#039;@&#039;localhost&#039;;\nFLUSH PRIVILEGES;\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 phpMyAdmin \u0e1a\u0e19 CentOS 1. \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Apach [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","footnotes":""},"categories":[105,117],"tags":[],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-centos","category-sql"],"_links":{"self":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":1,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"predecessor-version":[{"id":261,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/260\/revisions\/261"}],"wp:attachment":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}