Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I find manually editing MySQL databases tedious.

If the whole database was optionally represented as text files (as per Unix "everything is a file") for quick manually edits, searching and replacing would be much simpler.

Is it possible to represent MySQL database as text files?


A user asked to get something deleted from the forum database. Haven't found out how to search and delete it.

share|improve this question
As PatomaS said, doing this is not a good idea. Which forum are you using? If it's phpBB, I should be able to help. – Ivo van der Veeken Feb 17 '14 at 9:27
How do you currently edit/manage MySQL databases? Do you do everything on the command line, or use a GUI such as phpMyAdmin? – w3dk Feb 17 '14 at 14:43

You can export the database information as many text formats like CSV, JSON, TXT, SQL, etc.

But usually databases are more complex than just the information contained there, for instance, there may be dependencies between tables, autoincrement fields, foerign key restrictions, etc. If you just edit the exported text, you may be breaking some of the functionality or the data stored the database.

I seriously advise you not to do that can of external edits unless you are 100% sure of what you are doing and the data you are manipulating.

share|improve this answer

This sounds like you would benefit from a GUI to do this for you... However some one would need to build that for you (assuming you're not a developer).

Exporting to a different format is not advisable in most cases as if your database is relational or has any constrains, then editing without having these rules enforced will likely cause issues and prevent you from inputting your changes...

Since you wrote Haven't found out how to search and delete it. you'd use the following syntax

DELETE FROM MyTable WHERE MyColumn="The Value";

Of course, if you have a relational database then it may not be that simple as this could leave orphan's all over the place.

share|improve this answer

mysqldump is a database backup tool that can export the entire database to a single text file. You could use the Unix commands on that text file, and then use it to recreate the database.

share|improve this answer

It depends on your goal. If the goal is to delete message on your forum, the best idea is to manage it under the forum backend. Normally, each forum backend tool has a way to moderate all user actions.

I do not advise you to change directly contents directly from database. The data integrity may be corrupted following such direct database manipulation.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.