This site contains affiliate links — if you sign up through them we may earn a commission at no extra cost to you, without affecting our editorial neutrality. Details

MySQL Thailand Guide

MySQL Thailand Guide

What is MySQL

MySQL is the world's most popular database management system (DBMS) for web applications, using SQL (Structured Query Language) to manage data. Open source and free — WordPress, Drupal, Joomla, Magento, and millions of other applications use MySQL.

MySQL vs MariaDB

MariaDB is a MySQL fork created by the original MySQL developers after Oracle acquired MySQL. Nearly 100% compatible with MySQL but with some different features. Many hosts use MariaDB instead of MySQL for its performance advantages in certain workloads.

Interested in AsiaGB?

Check the latest plans and promotions on the official site.

Visit AsiaGB →

Database User

In cPanel, go to MySQL Databases → Create Database → Create User → Assign User to Database and set permissions. Create users with minimal required permissions — never use the root user for applications.

What is Index

Index in MySQL is a data structure that speeds up queries — like a book index helping you find pages faster than reading the whole book. Columns used in WHERE, JOIN, and ORDER BY clauses should be indexed. No index = Full Table Scan = slow.

Optimize MySQL Configuration

Set innodb_buffer_pool_size to 50-70% of RAM for InnoDB tables (most WordPress use). Enable query_cache_size for read-heavy sites. Set max_connections appropriately for your traffic — not higher than necessary.

Backup: Backup MySQL Database

Database backup is critical. The simplest method is mysqldump, which exports an SQL file schedulable via Cron Job. In cPanel, use MySQL Backup in the Backups section or phpMyAdmin's Export function.

Security: MySQL

Disable remote root login, use minimal-privilege users, set strong passwords, block MySQL port (3306) from external access if remote access isn't needed, run mysql_secure_installation after new installations.

Query Performance

Enable slow_query_log to log queries taking longer than N seconds. Use EXPLAIN to see query plans and index usage. If EXPLAIN shows type=ALL, it's a Full Table Scan requiring index addition. Check SHOW PROCESSLIST for currently running queries.

What is phpMyAdmin

phpMyAdmin is a web-based MySQL management interface. Every cPanel/DirectAdmin installation includes phpMyAdmin, allowing table browsing, query execution, database import/export, index creation, and user management.

Frequently Asked Questions (FAQ)

Which MySQL version does WordPress require?
WordPress 6.x requires MySQL 5.7+ or MariaDB 10.3+. MySQL 8.0 or MariaDB 10.6+ is recommended because they are faster, more secure, and offer better performance. Check the version available in cPanel -> MySQL Version or phpMyAdmin.
What do I do if my database is lost?
If your hosting has a daily backup, request a restore through a support ticket. If you exported it yourself, import it via phpMyAdmin or the mysql command. If you have no backup at all, recovery is difficult. Prevent this with automatic backups and keep a copy off the server.
Can a database that is too large slow down a website?
Yes. A large database without good indexes will query very slowly. In the case of WordPress, the wp_options and wp_postmeta tables often grow too large. Use a plugin like WP-Optimize to delete old data, then run OPTIMIZE TABLE to defragment.
Is phpMyAdmin secure?
phpMyAdmin itself is secure, but it must be configured correctly. To protect it: use a non-obvious URL (rename it), set an IP whitelist, use a strong password, update to the latest version, and consider disabling it if you do not need it. On most hosting, phpMyAdmin is already protected by cPanel authentication.