Vesta Control Panel (VestaCP) includes phpMyAdmin, a web-based tool for managing MySQL or MariaDB databases. Here is how to access, configure, and troubleshoot phpMyAdmin in VestaCP.

Access phpMyAdmin in VestaCP

1

Login to VestaCP

  • Go to your VestaCP login URL:
  • http://your-server-ip:8083
  • Enter your username and password.
2

Open phpMyAdmin

  • Navigate to the "DB" (Database) section in VestaCP.
  • Click the phpMyAdmin link at the top-right corner.
3

Login to phpMyAdmin

  • Use your database username and password to log in.

If you do not remember your credentials:

  • Look for them in your VestaCP database management section.
  • Or check the database configuration file of your application (e.g., wp-config.php for WordPress).

Default URL for phpMyAdmin

The default phpMyAdmin URL in VestaCP is:

http://your-server-ip/phpmyadmin

If you have changed your server domain or added SSL, it might be:

https://your-domain.com/phpmyadmin

Common Configurations

Changing phpMyAdmin Access URL

  1. Open the configuration file:
  2. sudo nano /etc/nginx/conf.d/phpmyadmin.conf
  3. Modify the location block to change the URL. For example:
  4. location /custom-phpmyadmin-url {
        alias /usr/share/phpMyAdmin;
        index index.php;
    }
  5. Save the file and restart Nginx:
  6. sudo systemctl restart nginx

Enable SSL for Secure phpMyAdmin Access

  1. Install a valid SSL certificate for your server (e.g., via Let's Encrypt in VestaCP).
  2. Force SSL redirection for phpMyAdmin:
    • Edit the Nginx configuration file:
    • sudo nano /etc/nginx/conf.d/phpmyadmin.conf
    • Add:
server {
    listen 443 ssl;
    server_name your-domain.com;

    ssl_certificate /path/to/ssl.crt;
    ssl_certificate_key /path/to/ssl.key;

    location /phpmyadmin {
        alias /usr/share/phpMyAdmin;
        index index.php;
    }
}
  1. Save and restart Nginx:
  2. sudo systemctl restart nginx

Troubleshooting phpMyAdmin Issues

Issue Solution
Cannot Access phpMyAdmin - Error 404
  • Ensure phpMyAdmin is installed:
  • sudo apt install phpmyadmin
  • Check the symbolic link for Nginx:
  • sudo ln -s /usr/share/phpMyAdmin /var/www/html/phpmyadmin
Access Denied Confirm database credentials in VestaCP or the application config file.
phpMyAdmin Not Loading Properly
  • Check PHP installation:
  • php -v
  • Ensure required PHP extensions are installed:
  • sudo apt install php-mbstring php-zip php-gd php-json php-curl
  • Restart PHP and Nginx:
  • sudo systemctl restart php7.x-fpm nginx
Too Many Redirects
  • Clear browser cache or use incognito mode.
  • Check the redirection settings in your Nginx configuration.
phpMyAdmin Fails After Update
  • Reconfigure phpMyAdmin if the database user cannot connect:
  • sudo dpkg-reconfigure phpmyadmin

Securing phpMyAdmin

  1. Restrict Access by IP:
    • Edit the Nginx config for phpMyAdmin:
    location /phpmyadmin {
        allow 192.168.1.0/24;
        deny all;
    }
  2. Password Protect phpMyAdmin:
    • Create a password file:
    • sudo htpasswd -c /etc/phpmyadmin/.htpasswd admin
    • Update Nginx config:
    location /phpmyadmin {
        auth_basic "Restricted Access";
        auth_basic_user_file /etc/phpmyadmin/.htpasswd;
    }
  • Access phpMyAdmin via VestaCP or directly through http://your-server-ip/phpmyadmin.
  • Configure SSL and secure access with IP restrictions or password protection.
  • If phpMyAdmin is not working, check installation, PHP extensions, and server configurations.