Search for all occurrences of a string in a mysql database [duplicate]
Solution 1:
A simple solution would be doing something like this:
mysqldump -u myuser --no-create-info --extended-insert=FALSE databasename | grep -i "<search string>"
Solution 2:
In phpMyAdmin a 'Search' feature is available:
- Select particular database not table.
- Click 'Search' tab
- Enter the search term you want
- Select the tables you want to search in
phpMyAdmin screen shot:
The 'Search' feature is also available in MySQL Workbench:
- Database Menu > Search Table Data
- Select database and tables you want to search (it will search in selected tables only)
- In search you can use wildChars.
MySQL Workbench screen shot:
Solution 3:
Old post I know, but for others that find this via Google like I did, if you have phpmyadmin installed, it has a global search feature.
Solution 4:
Using the MySQL Workbench, you can search for a string from the "Database" -> "Search Table Data" menu option.
Specify LIKE %URL_TO_SEARCH% and on the left side select all the tables you want to search through. You can use "Cntrl + A" to select the whole tree on the left, and then deselect the objects you don't care about.