The Nobregas MySQL Panel records every SQL query you execute on the server for security and auditing purposes. This guide covers best practices for managing your query activity and keeping your workspace clean.
What Gets Tracked
Every query you run on the SQL Query page is logged server-side with:
- The full SQL statement text.
- The database it was executed against.
- A timestamp of when it ran.
- Whether it succeeded or failed.
- Execution time and rows affected.
This logging helps with security auditing and troubleshooting.
Keeping Your Queries Organized
Use a Local Query File
Store important or frequently used queries in a local .sql file on your computer:
-- Get all active users
SELECT * FROM users WHERE active = 1;
-- Monthly revenue report
SELECT DATE_FORMAT(created_at, '%Y-%m') AS month, SUM(total) AS revenue
FROM orders GROUP BY month ORDER BY month DESC;
This gives you a personal library of queries you can copy into the editor anytime.
Use Comments in SQL
Add descriptive comments to your queries so you remember their purpose:
-- CAUTION: Deletes inactive users older than 1 year
DELETE FROM users WHERE active = 0 AND created_at < DATE_SUB(NOW(), INTERVAL 1 YEAR);
Security Best Practices
- Avoid putting sensitive data directly in queries — Use parameterized queries in your application code when dealing with passwords or personal information.
- Be cautious with destructive queries — Always run a SELECT first to preview which rows will be affected by a DELETE or UPDATE.
- Review before executing — Double-check the selected database and query text before clicking Execute.
What Clearing Does Not Affect
Clearing or managing your query history has no effect on:
- Your databases, tables, or data.
- Database users and their privileges.
- Other users' query activity.
- Any changes already made by previously executed queries — query logging is separate from the operations themselves.