1

I need to execute an cleaning operation on my mysql databases,

I have 140 wordpress databases under the same connection.

I have ~30 forbidden words.

I need to query all wp-post tables post-content columns find these 30 words, and remove the rows that include one of these words.

I must do it on each databases at once!

1 Answer 1

1

You could write a small program in java or c# to actually loop through all the databases.

If you execute show databases; this will retrieve all the databases that are present on you connection. From there I assume you know the tables on which you want to query for your forbidden words. Then you can loop within this new application for each database present and you will be able to query the wanted table.

Let me know if this is what you were expecting. If you want some code sample let me know.

Sign up to request clarification or add additional context in comments.

2 Comments

I forgot to add to this you need to be connected with a user that has privililedges on all those database to not encounter an access denied sort of error and please do not use root as this is a bad pratice. It is good for development purposes but not for production environments
Thank you so much Carl,but i found a programmer who will develop an interface with few more advanced options, i will let you know if i need help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.