XAMPP环境phpMyAdmin 4.7.9创建视图报错:404/服务器连接丢失求助
Hey Rick, let's work through this frustrating phpMyAdmin view creation issue together—this is a common problem with older phpMyAdmin versions like 4.7.9 running on XAMPP, so here are the fixes I've used to resolve similar cases:
The "server connection lost" pop-up usually happens because creating a view (especially with complex queries) takes longer than the default time limits allow:
- Open your phpMyAdmin config file (
xampp/phpmyadmin/config.inc.php) and find the line$cfg['ExecTimeLimit']. Change its value to300(or higher if needed):$cfg['ExecTimeLimit'] = 300; - Next, update PHP's time limits in
xampp/php/php.ini:- Set
max_execution_time = 300 - Set
max_input_time = 300
- Set
- Restart Apache and MySQL services in XAMPP after making these changes.
Older phpMyAdmin versions like 4.7.9 have a known bug where the view creation form uses an incorrect URL path, leading to 404s:
- Quick workaround: Skip the GUI and create your view directly with SQL. Run this query in the SQL tab:
CREATE VIEW your_view_name AS SELECT [your_columns] FROM your_table WHERE [your_conditions]; - Permanent fix: Open
xampp/phpmyadmin/db_structure.phpand locate the form that handles view creation. Look for theactionattribute of the form—replace any hardcoded absolute paths with a relative path like'db_structure.php'or ensure it matches your phpMyAdmin's actual URL path.
Sometimes cached browser data or stuck phpMyAdmin sessions cause weird UI glitches:
- Clear your browser's cache and cookies (use
Ctrl+Shift+Delon most browsers), then close all phpMyAdmin tabs and re-login. - Delete session files in
xampp/phpmyadmin/tmp/—remove all files starting withsess_to clear stale phpMyAdmin sessions.
If you have an .htaccess file in your phpMyAdmin directory, it might be blocking the view creation request:
- Rename the
.htaccessfile to.htaccess.baktemporarily, then test creating a view again. If it works, review the rewrite rules in the original file to see which one is causing the issue.
phpMyAdmin 4.7.9 is pretty outdated and often conflicts with newer XAMPP components. Upgrading to a newer, compatible version (like 4.8.x, which supports MySQL 5.7/8.0 well) usually resolves these bugs:
- Backup your current
xampp/phpmyadmin/directory. - Download a phpMyAdmin version that matches your XAMPP's MySQL version (check the phpMyAdmin release notes for compatibility).
- Extract the new version into
xampp/phpmyadmin/, then copy your oldconfig.inc.phpfile into the new directory to preserve your settings. - Restart Apache and MySQL, then test view creation again.
内容的提问来源于stack exchange,提问作者Rick

