How to Change MySQL Database Collation
Table of Contents
- What is Database Collation?
- Before You Start
- Step 1: Access cPanel
- Step 2: Open phpMyAdmin
- Step 3: Select Your Database
- Step 4: Change Database Collation
- Step 5: Change Table Collations
- Step 6: Test Your Website
- Common Collation Types
- Troubleshooting
- Getting Help
What is Database Collation?
Simple Explanation
Database collation determines how your database sorts and compares text. It affects:
- How text is sorted (A-Z order)
- Whether searches are case-sensitive
- How special characters are handled
- Support for different languages
Why Change Collation?
- To support special characters (like é, ñ, ü)
- To fix sorting issues with names or text
- To support different languages properly
- To match your website's language requirements
Warning
Always backup your database before making changes! Changing collation can affect how your data is displayed and sorted.
Before You Start
What You'll Need
- Access to your cPanel account
- Your database name
- About 10-20 minutes
- Important: A backup of your database
Create a Backup First
- Go to cPanel ? Databases ? phpMyAdmin
- Select your database
- Click "Export" at the top
- Click "Go" to download your backup
- Save this file somewhere safe!
Step 1: Access cPanel
Method 1: Through iFastNet Client Portal
- Go to
https://ifastnet.com/portal/clientarea.php - Log in with your iFastNet account details
- Find your hosting service
- Click "Login to cPanel"
Method 2: Direct Access
- Go to
https://yourdomain.com/cpanel(replace "yourdomain.com" with your domain) - Enter your cPanel username and password
- Click "Log in"
Step 2: Open phpMyAdmin
- In cPanel, scroll down to the "Databases" section
- Click on "phpMyAdmin"
- phpMyAdmin will open in a new window/tab
- You'll see a list of your databases on the left side
Step 3: Select Your Database
- Look at the list of databases on the left side
- Click on the database you want to change
- The database will expand to show its tables
- The main area will show information about your database
Step 4: Change Database Collation
- With your database selected, click on the "Operations" tab at the top
- Scroll down to find the "Collation" section
- You'll see a dropdown menu with the current collation
- Click the dropdown to see available collations
- Choose your new collation (see Common Collation Types below)
- Click "Go" to apply the change
- You should see a success message
Most Common Choices
- utf8mb4_unicode_ci - Best for international websites
- utf8mb4_general_ci - Good general purpose option
- latin1_swedish_ci - For English-only websites
Step 5: Change Table Collations
Important: Changing the database collation doesn't automatically change existing tables. You need to change each table separately.
For Each Table in Your Database:
- Click on a table name from the list on the left
- Click the "Operations" tab at the top
- Scroll down to the "Table options" section
- Find the "Collation" dropdown
- Select the same collation you chose for the database
- Click "Go"
- Repeat this for every table in your database
Quick Method for All Tables:
- Select your database from the left sidebar
- Click "Check All" at the bottom of the table list
- From the "With selected:" dropdown, choose "Change table collation"
- Select your new collation
- Click "Go"
Step 6: Test Your Website
- Visit your website in a web browser
- Check that text displays correctly
- Test any search functions
- Look for any strange characters or formatting issues
- Test forms and user input features
Things to Check
- Special characters display correctly (é, ñ, ü, etc.)
- Sorting works properly (A-Z order)
- Search functions work as expected
- No strange symbols or question marks in text
Common Collation Types
For International/Multi-language Websites
- utf8mb4_unicode_ci - Best choice for most websites
- utf8mb4_general_ci - Faster but less accurate sorting
For English-only Websites
- latin1_swedish_ci - Traditional choice for English
- utf8mb4_unicode_ci - Still recommended even for English
For Specific Languages
- utf8mb4_bin - Case-sensitive, exact matching
- utf8mb4_unicode_520_ci - Latest Unicode standard
What the Endings Mean
- ci = Case Insensitive (A = a)
- cs = Case Sensitive (A ? a)
- bin = Binary (exact byte comparison)
Troubleshooting
My website shows strange characters
Problem: Text shows as question marks or weird symbols Solution:
- Make sure you chose a UTF8 collation (utf8mb4_unicode_ci)
- Check that your website files are also saved in UTF-8 format
- You may need to re-enter affected text
Sorting is not working correctly
Problem: Names or lists don't sort in alphabetical order Solution:
- Make sure all tables have the same collation
- Try utf8mb4_unicode_ci for better sorting
- Check that your application isn't overriding the sort order
I can't see the Operations tab
Problem: The Operations tab is missing or grayed out Solution:
- Make sure you selected a database or table first
- Try refreshing phpMyAdmin
- Check that you have proper permissions
Changes didn't take effect
Problem: The collation shows as changed but text still looks wrong Solution:
- Make sure you changed BOTH database AND table collations
- Clear your browser cache
- You may need to re-import your data
Getting Help
iFastNet Support
If you need help or something goes wrong:
- Support Portal: Go to
https://support.ifastnet.com/login.php - First time? Click register to create a support account
- Existing users: Log in with your support credentials
- Create a new support ticket
Alternative Support Access
You can also access support through your client portal at https://ifastnet.com/portal/clientarea.php
What to Include in Your Support Request
- Your domain name
- The database name you're working with
- What collation you're trying to change to
- Any error messages you're seeing
- Screenshots of the problem (if possible)
Before Contacting Support
- Make sure you have a backup of your database
- Try refreshing phpMyAdmin and trying again
- Check that you followed all steps correctly
- Note down any error messages exactly as they appear
Important Reminders
Always Backup First
- Export your database before making any changes
- Save the backup file in a safe location
- Test that you can restore from the backup if needed
Be Patient
- Collation changes can take time on large databases
- Don't close phpMyAdmin while changes are processing
- Wait for success messages before moving to the next step
Test Everything
- Check your website thoroughly after making changes
- Test all features that involve text or searching
- Look for any display problems with special characters
Remember: If something goes wrong, you can always restore your database from the backup you created before starting!



