OTRS 5.0.2:直接修改MySQL customer_user表后前端无法显示更新内容
Ah, this is a common gotcha when working with OTRS directly on the database! Let me break down why this happens and how to fix it:
OTRS 5.0.2 relies heavily on internal caching layers and doesn’t pull data directly from the database on every page load. When you modify the customer_user table directly via SQL, you’re bypassing OTRS’s core logic that handles cache invalidation and session syncing—so the frontend keeps serving stale cached data instead of your fresh updates.
Here are the steps you can take, ordered from simplest to more involved:
1. Clear OTRS Cache
OTRS stores cached customer data to speed up frontend loads. You need to clear this cache to force it to fetch fresh data from the database:
- Log into your OTRS server via SSH or terminal
- Run the following command as the OTRS user (usually
otrs):/opt/otrs/bin/otrs.Console.pl Maint::Cache::Delete - Alternatively, if you have admin access to the OTRS frontend:
- Navigate to Admin > System Configuration
- Search for
Cache::Delete - Click the Execute button next to the
Maint::Cache::Deleteoption
2. Reset Customer Sessions
If the customer was logged in when you made the database change, their frontend session might still hold old cached data:
- Ask the customer to log out and log back in
- If you can’t reach the customer, invalidate all customer sessions via the OTRS console:
/opt/otrs/bin/otrs.Console.pl Maint::Session::Delete --type Customer
3. Verify Your Database Changes Are Correct
Double-check that your SQL update actually modified the right records—typos or incorrect WHERE clauses can trick you into thinking the update worked when it didn’t:
- Run a SELECT query to confirm:
Ensure the updated fields match what you expected.SELECT * FROM customer_user WHERE login = 'your_customer_login';
4. Check OTRS Customer Backend Configuration
Make sure OTRS is using the database backend for customer users (not LDAP or another external source):
- Go to Admin > Customer User Configuration
- Verify that the
Backendis set toKernel::System::CustomerUser::DB - If it’s set to another backend, your direct database changes won’t be picked up by OTRS at all.
Instead of modifying the database directly, use OTRS’s built-in tools or API to update customer data—this way, OTRS handles cache invalidation automatically:
- Use the OTRS admin interface (Admin > Customer Users) to edit users individually
- Or use the console command for bulk updates:
/opt/otrs/bin/otrs.Console.pl Admin::CustomerUser::Update --login <customer_login> --key <field_name> --value <new_value>
内容的提问来源于stack exchange,提问作者Luis Costela

