Overview
This guide covers common issues you may encounter while using the MySQL SQL Editor, along with their solutions based on the application’s error handling logic.Connection Issues
Connection Refused Error
Connection Refused Error
Symptoms
Error message in login view:Root Causes
Source:Model.java:54-58 - DriverManager.getConnection() fails- MySQL Server Not Running
- The MySQL service is stopped
- The server crashed or failed to start
- Wrong Server Address
- Selected server is not running MySQL
- Firewall blocking port 3306
- Port Already in Use
- Another service is using port 3306
- MySQL is running on a different port
Solutions
Check MySQL Port
Verify MySQL is listening on port 3306:
The application only supports port 3306. If your MySQL server uses a different port, you’ll need to modify the connection string in
Model.java:28 and Model.java:54-55.Authentication Failed Error
Authentication Failed Error
Symptoms
Error message in login view:Root Causes
Source:Model.java:26-42 (database discovery), Model.java:53-59 (connection)- Invalid Username
- Username does not exist in MySQL
- Typo in username field
- Incorrect Password
- Wrong password entered
- Password contains special characters not properly entered
- User Permissions
- User exists but doesn’t have required privileges
- User is restricted to specific hosts
Solutions
Check User Privileges
If login works via CLI, check user permissions:Required privileges:
SELECT- For query executionINSERT,UPDATE,DELETE- For data modificationCREATE,DROP,ALTER- For schema changesSHOW DATABASES- For database discovery (required)
Empty Database List
Empty Database List
Symptoms
After clicking “Actualizar”, the database combo box remains empty with error:Root Causes
Source:Model.java:36-38 - System databases are filtered out- No User Databases
- Only system databases exist (information_schema, mysql, performance_schema, sys)
- All user databases were dropped
- Insufficient Privileges
- User cannot execute
SHOW DATABASES - User has access but grants are not visible
- User cannot execute
Solutions
Check Existing Databases
Connect via MySQL CLI and run:Verify that databases other than system databases exist.
The filter regex is:
information_schema|mysql|performance_schema|sys (Model.java:36). Databases matching these patterns are never shown.Connection Timeout
Connection Timeout
Symptoms
Application freezes or shows error after long wait:Root Causes
Source: Async operations inController.java- Network Issues
- Slow or unreliable network connection
- Remote server not responding
- Server Overload
- MySQL server is under heavy load
- Too many concurrent connections
- Firewall/Proxy
- Firewall dropping packets
- Proxy interfering with connection
Solutions
SSL Connection Error
SSL Connection Error
Symptoms
Warning or error about SSL certificate:Root Cause
Source:Model.java:28, Model.java:54-55 - useSSL=false parameterMySQL server requires SSL but application disables it.Solution
Query Execution Issues
Empty Query Warning
Empty Query Warning
SQL Syntax Error
SQL Syntax Error
Symptoms
Error dialog and system message:Root Causes
Source:Model.java:101-154 - SQLException from Statement.executeQuery() or executeUpdate()- Invalid SQL Syntax
- Missing keywords (SELECT, FROM, WHERE, etc.)
- Incorrect column/table names
- Unmatched quotes or parentheses
- Reserved Keyword Usage
- Using reserved words without backticks
- Example:
SELECT order FROM orders(should be`order`)
- Missing Semicolon (rare)
- Some queries require explicit termination
Solutions
Verify Query Syntax
Check for common errors:
- Missing
FROMclause in SELECT - Missing
WHEREcolumn name - Unmatched quotes:
'valueinstead of'value'
The application does not perform client-side SQL validation. All syntax errors are caught when MySQL processes the query.
Table or Column Not Found
Table or Column Not Found
Symptoms
Error dialog:Root Causes
Source: SQLException fromStatement.executeQuery() or executeUpdate()- Typo in Name
- Incorrect spelling of table or column
- Wrong case (if database is case-sensitive)
- Wrong Database
- Connected to different database than intended
- Table exists but in another schema
- Table Dropped
- Table was deleted after table list was populated
- Table list needs refreshing
Solutions
Query Returns No Results
Query Returns No Results
Symptoms
Query executes successfully but result table is empty.System message shows:Root Causes
Not an error - This is normal behavior for:- No Matching Rows
- WHERE clause filters out all rows
- Table is empty
- Successful Modification
- INSERT/UPDATE/DELETE executed on empty table
- Query affected 0 rows
Verification
Constraint Violation Error
Constraint Violation Error
Symptoms
Error dialog:Root Causes
Source: SQLException fromStatement.executeUpdate()- Primary Key Violation
- Attempting to insert duplicate primary key
- Unique constraint violation
- Foreign Key Violation
- Referencing non-existent parent row
- Attempting to delete parent row with children
- NOT NULL Violation
- Inserting NULL into NOT NULL column
- Missing required columns in INSERT
Solutions
Query Timeout or Long Execution
Query Timeout or Long Execution
Symptoms
Application appears frozen during query execution.UI is responsive but no results appear for a long time.Root Causes
Source:Controller.java:242-264 - SwingWorker execution- Large Result Set
- SELECT without LIMIT on huge table
- Returning millions of rows
- Missing Index
- Query scans entire table without index
- JOIN without proper indexing
- Expensive Operations
- Complex calculations or aggregations
- Large GROUP BY or ORDER BY operations
Solutions
Check Query Performance
Use EXPLAIN to analyze query:Look for “type: ALL” which indicates full table scan.
All queries execute asynchronously using SwingWorker (
Controller.java:242-264). The UI remains responsive even during long queries, but results won’t appear until execution completes.UI Responsiveness Issues
Application Freezes During Operation
Application Freezes During Operation
Symptoms
UI becomes unresponsive and cannot be interacted with.Buttons and text fields are grayed out.Root Cause
Expected Behavior -View.bloquearInterfaz(true) is activeSource: View.java:239-252, Controller.java:110, Controller.java:150The interface is intentionally locked during async operations:- Database list loading
- Database connection
- Query execution
- Table refresh
Normal vs. Problem
Normal:- Controls are grayed out
- Operation completes within seconds
- Interface unlocks automatically
- Operation takes very long time
- Interface never unlocks
- Application must be force-closed
Solutions
Wait for Operation to Complete
Check if this is a long-running query or slow network.The application will unlock automatically when the operation finishes.
Restart Application
If truly frozen:
- Force quit the application
- Check MySQL server status
- Verify network connectivity
- Restart the application
Table List Not Updating
Table List Not Updating
Symptoms
After creating or dropping tables, the “Tablas disponibles” list doesn’t reflect changes.Root Cause
Source:SqlEditorView.java:305-317 - List is not auto-refreshedThe table list is only updated:- After initial connection (
Controller.java:172-173) - When “Refrescar tablas” is clicked (
Controller.java:64)
Solution
Click the “Refrescar tablas” button to reload the table list (Controller.java:192-212).Results Not Displayed
Results Not Displayed
Symptoms
Query executes successfully (system message shows success) but no results appear in table.Root Causes
- Empty Result Set
- Query returned 0 rows (see “Query Returns No Results” above)
- Modification Query
- INSERT/UPDATE/DELETE shows affected row count instead of results
- Source:
Model.java:124,Model.java:147-148
- Previous Results Not Cleared
- Old results still displayed from previous query
Solutions
Check System Message
Read the message above the results table:
- “Consulta ejecutada correctamente” = Success
- “Filas afectadas: N” = Modification query
- “Error: …” = Query failed
Clear Previous Results
Click “Limpiar” to clear old results before executing new query (
SqlEditorView.java:281-285).Cannot Change Database
Cannot Change Database
Symptoms
Clicking “Cambiar BD” does nothing or shows error:Root Causes
Source:Controller.java:66-76, Controller.java:217-228- Confirmation Cancelled
- User clicked “No” on confirmation dialog
- Expected behavior, not an error
- Connection Already Closed
- Connection was terminated externally
- SQLException during disconnect
Solutions
JDBC Driver Issues
ClassNotFoundException: com.mysql.jdbc.Driver
ClassNotFoundException: com.mysql.jdbc.Driver
Symptoms
Application fails to start or shows error:Root Cause
Source: JDBC connection attempts inModel.java:30, Model.java:54-58MySQL Connector/J JAR is missing from classpath.Solutions
Add to Classpath
Command Line:IDE (Eclipse/IntelliJ):
- Right-click project → Properties/Settings
- Add External JARs
- Select
mysql-connector-j-x.x.x.jar - Rebuild project
Driver Version Mismatch
Driver Version Mismatch
Symptoms
Warnings in console:Root Causes
- Old Driver with New MySQL
- MySQL Connector/J 5.x with MySQL 8.0
- Deprecated driver class
- Authentication Plugin Mismatch
- MySQL 8.0 uses
caching_sha2_password - Old drivers don’t support this
- MySQL 8.0 uses
Solutions
Error Message Reference
Login View Errors
| Error Message | Source | Cause | Solution |
|---|---|---|---|
| ”El usuario es requerido” | Controller.java:86 | Empty username field | Enter username |
| ”La contraseña es requerida” | Controller.java:91 | Empty password field | Enter password |
| ”Debe seleccionar una base de datos” | Controller.java:96 | No database selected | Select from dropdown or click Actualizar |
| ”No se encontraron bases de datos” | Controller.java:129 | No user databases exist | Create a database in MySQL |
| ”Error: “ | Controller.java:137, Controller.java:180 | Connection/query failed | Check MySQL server, credentials, network |
| ”Error de conexión: “ | Controller.java:180 | Connection failed | Verify server is running, credentials are correct |
Editor View Errors
| Error Message | Source | Cause | Solution |
|---|---|---|---|
| ”Ingrese una consulta SQL” | Controller.java:236-238 | Empty query | Enter SQL query |
| ”Error en la consulta: “ | Controller.java:257-258 | SQL error | Check syntax, table names, permissions |
| ”Error al obtener tablas: “ | Controller.java:205-207 | Table list refresh failed | Check connection, database still exists |
| ”Error al desconectar: “ | Controller.java:224-226 | Disconnect failed | Force quit and restart |
| ”Consulta ejecutada correctamente” | Controller.java:253 | Query succeeded | Normal success message |
| ”Filas afectadas: “ | Model.java:148 | Modification query | Shows number of affected rows |
Getting Additional Help
Check MySQL Logs
MySQL error logs contain detailed information about connection issues and query errors.Log Locations:
- Linux:
/var/log/mysql/error.log - Windows:
C:\ProgramData\MySQL\MySQL Server 8.0\Data\*.err - macOS:
/usr/local/mysql/data/*.err
Enable JDBC Logging
Add logging to connection URLs in
Model.java for debugging:Test with MySQL CLI
Always test problematic queries in the MySQL command-line client first:If the query fails in CLI, it’s a MySQL issue, not an application issue.
Most issues stem from MySQL configuration, credentials, or network connectivity rather than the application itself. Always verify external dependencies first.