Skip to content

Instantly share code, notes, and snippets.

@enqtran
Last active July 17, 2019 08:25
Show Gist options
  • Save enqtran/81a41fe3064850e80f9a990e446dbcfd to your computer and use it in GitHub Desktop.
Save enqtran/81a41fe3064850e80f9a990e446dbcfd to your computer and use it in GitHub Desktop.
1. requirements
Apache >= 2.2
PHP >= 5.5
MySQL/MariaDB >= 5.5
Step 1 – Enable Remi Repository
### CentOS/RHEL 7 ###
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
### CentOS/RHEL 6 ###
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Step 2 – Install PhpMyAdmin on CentOS
yum --enablerepo=remi,remi-test install phpMyAdmin
Step 3 – Configure PhpMyAdmin
sudo vi /etc/httpd/conf.d/phpMyAdmin.conf
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
service httpd restart
Step 4 – Access phpMyAdmin in Browser
sudo setenforce 0
getenforce
ls -ld /usr/share/phpMyAdmin /var/www/html
service httpd restart
http://domain/phpMyAdmin/
Login Details: Use MySQL username and password.
mysql
use mysql;
UPDATE mysql.user SET Password=PASSWORD("new_password") WHERE User="root";
FLUSH PRIVILEGES;
exit;
/usr/share/phpMyAdmin/libraries/config.default.php
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
$cfg[‘Servers’][$i][‘password’] = "new_password";
service httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment