CentOS 8:
- Install phpMyAdmin:
sudo dnf install epel-release
sudo dnf install phpmyadmin
During the installation, you will be prompted to configure phpMyAdmin with the web server. Choose the web server you are using (e.g., apache) and confirm the configuration.
- Edit the phpMyAdmin configuration file:
sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
Replace nano
with your preferred text editor if it’s different.
Make sure the following lines are present and adjust them if needed:
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require all granted
</Directory>
- Restart Apache:
sudo systemctl restart httpd
Now, you should be able to access phpMyAdmin by visiting http://your_server_ip/phpMyAdmin
in your web browser.
Ubuntu 20.04:
- Install phpMyAdmin:
sudo apt update
sudo apt install phpmyadmin
During the installation, you will be prompted to configure phpMyAdmin with the web server. Choose the web server you are using (e.g., apache2) and confirm the configuration.
- Enable the phpMyAdmin Apache configuration:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
- Restart Apache:
sudo systemctl restart apache2
Now, you should be able to access phpMyAdmin by visiting http://your_server_ip/phpmyadmin
in your web browser.
Remember to replace your_server_ip
with the actual IP address or domain of your server. Additionally, ensure that your firewall allows traffic on the necessary ports (e.g., port 80 for HTTP) to access phpMyAdmin.