What is phpMyAdmin?

phpMyAdmin is a web-based tool for managing MySQL databases. It allows you to browse tables, run SQL queries, import/export data, and manage database users through an intuitive interface.

Accessing phpMyAdmin

  1. Log in to EGPNL
  2. Navigate to DatabasesphpMyAdmin
  3. Select the database you want to manage
  4. phpMyAdmin opens in a new tab
Direct Access: You may also access phpMyAdmin directly via https://yourdomain.com/phpmyadmin if enabled.

phpMyAdmin Interface

The main interface consists of:

  • Left Panel: Database and table navigation
  • Top Menu: SQL, Search, Query, Export, Import, Operations
  • Main Area: Table data and query results

Common Tasks

Browse Table Data

  1. Click on a database in the left panel
  2. Click on a table name
  3. Click Browse to view rows
  4. Use pagination to navigate through records

Run SQL Queries

  1. Select your database
  2. Click the SQL tab
  3. Enter your SQL query
  4. Click Go to execute
-- Example: Select all users
SELECT * FROM users WHERE status = 'active';

-- Example: Update a record
UPDATE products SET price = 29.99 WHERE id = 5;

-- Example: Delete records
DELETE FROM logs WHERE created_at < '2024-01-01';
Caution: Always backup your database before running UPDATE or DELETE queries. There's no undo button!

Search Data

  1. Select a table
  2. Click the Search tab
  3. Enter search criteria for each column
  4. Click Go to find matching records

Edit Records

  1. Browse the table
  2. Click Edit next to any row
  3. Modify the values
  4. Click Go to save

Add New Records

  1. Select a table
  2. Click the Insert tab
  3. Fill in the values for each column
  4. Click Go to insert

Export Database

  1. Select the database
  2. Click Export tab
  3. Choose Quick or Custom export
  4. Format: SQL (recommended)
  5. Click Go to download
Custom Export: Use custom export for more options like compression (gzip), specific tables, or data-only exports.

Import Database

  1. Select the target database (or create a new one)
  2. Click Import tab
  3. Click Choose File and select your .sql file
  4. Click Go to import

Import Size Limits

phpMyAdmin has upload limits. For large files:

  • Compress the .sql file to .sql.gz
  • Use command line MySQL import instead
  • Split large files into smaller chunks

Table Operations

Create a New Table

  1. Select the database
  2. Enter table name and number of columns
  3. Click Go
  4. Define each column (name, type, length, etc.)
  5. Click Save

Modify Table Structure

  1. Select the table
  2. Click Structure tab
  3. Use Add column or click Change on existing columns

Optimize Tables

  1. Select tables to optimize
  2. From dropdown, select Optimize table
  3. This reclaims unused space and improves performance

Useful SQL Queries

Find & Replace

UPDATE wp_posts
SET post_content = REPLACE(post_content, 'http://oldsite.com', 'https://newsite.com');

Reset WordPress Password

UPDATE wp_users
SET user_pass = MD5('newpassword')
WHERE user_login = 'admin';

Show Table Sizes

SELECT table_name,
       ROUND((data_length + index_length) / 1024 / 1024, 2) AS 'Size (MB)'
FROM information_schema.tables
WHERE table_schema = 'your_database'
ORDER BY (data_length + index_length) DESC;