.How do I connect Shopware 6 to MySQL with utf8mb4 and correct collation?
Quick Answer
To connect Shopware 6 to MySQL correctly, you should use utf8mb4 character encoding with a modern collation like utf8mb4_unicode_ci or utf8mb4_0900_ai_ci. This prevents emoji issues, broken special characters, and indexing problems later. The safest approach is to create the database manually first, then point Shopware to it during installation.
Before You Start
- ✦ MySQL 8 or MariaDB 10.11+ — older versions can cause collation mismatches during migrations.
- ✦ Database access credentials — you’ll need permission to create databases and users.
- ✦ Terminal or phpMyAdmin access — this is the easiest way to verify charset and collation settings.
Create the database
Start by creating the Shopware database manually instead of letting the installer generate it automatically. This gives you full control over encoding and collation from the beginning. Most strange search, sorting, and emoji issues later come from databases created with legacy utf8 instead of utf8mb4.
- Open MySQL CLI or phpMyAdmin
- Create a dedicated database for Shopware
- Use utf8mb4 as the default character set
CREATE DATABASE shopware
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;Create a dedicated database user
Don’t use the MySQL root account for Shopware production stores. Create a dedicated user with permissions limited to the Shopware database only. This keeps your server safer and avoids deployment mistakes where scripts accidentally modify other databases on the same server.
- Create a separate MySQL user
- Grant privileges only on the Shopware database
- Use a strong password with symbols and numbers
CREATE USER 'shopware_user'@'localhost'
IDENTIFIED BY 'StrongPasswordHere';
GRANT ALL PRIVILEGES ON shopware.*
TO 'shopware_user'@'localhost';
FLUSH PRIVILEGES;Configure Shopware database connection
During installation, Shopware asks for your database credentials. Enter the database name, username, password, and host you created earlier. Shopware will then build all tables using the database defaults already configured with utf8mb4 support.
- Enter the database host correctly
- Use the dedicated Shopware database user
- Complete the installer normally
Verify charset and collation
After installation, verify the database settings before importing products or customer data. This catches problems early while the store is still clean. Once large imports start, changing collations becomes much harder and slower.
- Run a SHOW CREATE DATABASE query
- Confirm utf8mb4 appears in the output
- Check several large tables manually
SHOW CREATE DATABASE shopware;Shopware Database Setup Checklist
0 of 6 completeMistakes Most Developers Make
! Using plain utf8
What happens: Emoji and multilingual characters fail or become corrupted during imports.
Fix: Create the database with utf8mb4 before installing Shopware.
! Mixing MariaDB collations
What happens: Some migrations or extensions fail because table collations don’t match.
Fix: Keep one consistent utf8mb4 collation across the full database.
! Using root database access
What happens: Deployment scripts and imports can accidentally affect unrelated databases.
Fix: Use a dedicated Shopware database user with limited permissions.
Key Takeaway
The short version: create your Shopware database manually with utf8mb4 before installation, use a consistent collation across every table, and avoid using legacy utf8 entirely. Most database character problems appear months later during imports, ERP integrations, or multilingual expansions. Using a dedicated database user also prevents deployment and security issues later. Start with Step 1—that one alone handles most of it.
Related Answers
Still need help?
Talk to our Shopware experts
We've handled GDPR/CCPA compliance for dozens of EU & US Shopware stores.