Installation and Configuration of phpMyAdmin
- Install phpMyAdmin.
sudo yum install phpmyadmin
- Create a symbolic link to your public_html folder. In some cases /usr/share/phpmyadmin is use.
sudo ln -s /usr/share/phpMyAdmin /var/www/yourdomain.com/public_html
- If you encounter an error for accessing phpMyAdmin, follow the instructions below.
- Add a session folder.
mkdir -p /var/lib/php/session
- Configure config.inc.php permission/access.
sudo chmod 755 -R /usr/share/phpmyadmin/config.inc.php
- Find this line:
$cfg['blowfish_secret'] = ; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
- Add a blowfish password on it with any random characters and/or numbers being unique to your instance for phpMyAdmin. Maximum string length is 48.
$cfg['blowfish_secret'] = 'yourblowfishpassword'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
- If you encounter an mbstring error, install php-mysql, php-mbstring, php-mcrypt and php-gd:
sudo systemctl restart php-fpm
sudo yum -y install php-mysql sudo yum -y install php-mbstring php-mcrypt php-gd
sudo systemctl restart php-fpm
- Add a session folder.
- Change session.inc.php user permission access for public.
sudo chown nginx:nginx /usr/share/phpmyadmin/libraries/session.inc.php -R
sudo chmod 755 /usr/share/phpmyadmin/libraries/session.inc.php -R
- To adjust maximum upload SQL size, browse nginx.conf and add max body size inside http.
sudo nano /etc/nginx/nginx.conf
# set client body size to 2M client_max_body_size 2M;
- Secure phpMyAdmin using the instructions below.
- Rename your phpMyAdmin shortcut (symbolic link).
sudo mv phpMyAdmin yournewphpmyadminname
- Generate SSL password using Linux, then save the password to use it on the next step.
openssl passwd
- Change Admin password.
sudo nano /etc/nginx/pma_pass
Admin:Yourgeneratedpassword
- Browse your site configuration file from sites-available.
sudo nano /etc/nginx/sites-available/yourdomain.com.conf
Add these data inside your server { } block.
location /yournewphpmyadminname { auth_basic "Admin Login"; auth_basic_user_file /etc/nginx/pma_pass; }
- Rename your phpMyAdmin shortcut (symbolic link).
You are now done and ready to use your server. You can install WordPress on it and add your database using phpMyAdmin.