Mobile app version of vmapp.org
Login or Join
Angie530

: Is it possible to represent MySQL database as text files? I find manually editing MySQL databases tedious. If the whole database was optionally represented as text files (as per Unix "everything

@Angie530

Posted in: #Database #Mysql #Text

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?

Background:

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

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Angie530

4 Comments

Sorted by latest first Latest Oldest Best

 

@Vandalay111

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.

10% popularity Vote Up Vote Down


 

@Heady270

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.

10% popularity Vote Up Vote Down


 

@Welton855

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.

10% popularity Vote Up Vote Down


 

@Yeniel560

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme